GNOME Bugzilla – Bug 144969
mdns/dns-sd support
Last modified: 2005-07-24 13:07:46 UTC
Comment from Alex on possible user interface: Yeah. Something like that, or perhaps a services menu with the browsedservices in it. The list of mDNS services is dynamic, so perhaps a menuworks better than a webpage. Safari currently has a "Rendezvous" bookmark "source" which shows allthe locally (link-local that is) availible web servers, so that you caneasily browse peoples webservers on ad-hoc networks without having totype in the ip addresses or anything like that. We should be able to do that, and we should also support site-widedns-sd configurations, so that you can easilly access a list ofimportant web services for the domain you're currently in. For instance,a redhat box called "foo.devel.redhat.com" would automatically browsethe domains listed in the devel.redhat.com domain and show things like: intranet, bugzilla, internal web apps, etc.
*** Bug 152245 has been marked as a duplicate of this bug. ***
It should be possible to implement this as an epiphany-extensions. Unfortunately, the extensions API isn't very clear. It should be easy to implement this if examples were provided for: - toolbar sub-menus - a way to override the URL bar (you wouldn't want to bookmark the actual resolution of a service name)
Marco said that this could be added to the core, rather than as an extension.
Mass reassigning of Epiphany bugs to epiphany-maint@b.g.o
'Rendezvous' might be able to be added as a special topic (like the 'Most Visited' topic) in the current bookmarks system. This would have to be implemented within the core though, and not as an extension. How exactly do we get the list of local URLs? A longer term goal would be to allow for multiple bookmark sources. I'll be looking into it soonish. If you want this implemented sooner you can write it as an extension (separate from the bookmarks system), which creates it's own menu in the window. That should be simple enough to do, assuming that we can get the list of URLs easily. Look at ephy-topic-action.c for an example of a toolbar widget which has a drop-down menu. But you will have some problems getting an item added to the toolbar. I have been making largish changes to the toolbar code to fix this, but it's nowhere near ready to commit to CVS. Btw, what is the problem with bookmarking the resolution of a service name? Isn't the 'resolution of a service name' effectively just a URL? I've never dealt with Rendezvous before so please correct me if I'm wrong.
Is there any program using the gnome-vfs SD APIs that I could look at to see how it's done? Also, what type of service should we look for, only "http" ? [http://www.dns-sd.org/ServiceTypes.html]
Hmmm, not sure about anyone using gnome-vfs SD. It seems most people have gone straight to howl instead. Of course Alex did put in a test program that might help you. http://cvs.gnome.org/viewcvs/gnome-vfs/test/test-dns-sd.c?view=markup Also, this is a good thread with a few explanations: http://mail.gnome.org/archives/gnome-vfs-list/2004-July/msg00000.html Here's a quick list of other programs that use howl in case that's any help. Gnome Meeting - Publisher http://cvs.gnome.org/viewcvs/gnomemeeting/src/zeroconf_publisher.cpp?rev=1.7&view=auto - Browser http://cvs.gnome.org/viewcvs/gnomemeeting/lib/contacts/gm_contacts-zeroconf.cpp?rev=1.9&view=auto Gnome User Share does publishing of a service, so you can check out the howl API for setup and such through there. http://cvs.gnome.org/viewcvs/gnome-user-share/user_share.c?rev=1.9&view=auto Gnome VFS has browsing of services: http://cvs.gnome.org/viewcvs/gnome-vfs/libgnomevfs/gnome-vfs-dns-sd.c?rev=1.9&view=auto
Some discussion with Christian, on IRC: <chpe> hadess: I see, hmm. I think it could be done by adding a special "Local sites" topic in the bookmarks (like the "All", "Most visited" topics). To add it to the bmbar, you'd have to dnd it from the bme to the bmbar, then <chpe> (adding the topic can be done mostly from extension, but I'm not opposed to it being in core, either) <chpe> hadess: the code is in src/bookmarks/ephy-bookmarks.c <chpe> hadess: if we have the "Local sites" topic, it's just a matter of adding a bookmark for the discovered site, and adding it to the topic (ephy_node_add_child) <chpe> would need a tiny change in ephy itself so as to not save those 'bookmarks'
Created attachment 39636 [details] [review] ephy-add-local-menu.patch First draft of the patch. We need to make changes to EphyNode to allow the local sites not to be saved.
Created attachment 39640 [details] [review] ephy-add-local-menu-3.patch As above, but doesn't save .local sites. Those changes are from Christian. The local sites bookmarks are still removable though...
I haven't managed to make the bookmarks undeletable. Christian, Marco, is the code still good to go in?
Created attachment 39641 [details] [review] ephy-add-local-menu-4.patch There was one line too much, removing menu entries works now.
Comment on attachment 39641 [details] [review] ephy-add-local-menu-4.patch First, thanks for the patch! * I committed a slightly modified version of the save filter patch to Epiphany HEAD, so this patch needs an update. * This still allows the user to choose Properties from the context menu in the bookmarks editor, and then change its properties. I think we should disallow that. A simple way would be to introduce ephy_node_[gs]et_immutable() and check that before opening props dialogue (or better, set properties insensitive in context menu and main menu). * The user could conceivably DND one of the local bookmarks to the bookmarks bar, as a shortcut. That poses the question of how we should represent the data: can the same 'service' later refer to a different URL? If so, we should perhaps invent a special 'URL' for the bookmark derived from its service name, and only resolve the real URL when loading the bookmark? * The user also might DND the local bmk to another topic. We need to either disable that, or have a way to store this association. * Now a few code comment: >Index: src/bookmarks/ephy-bookmarks.c >@@ -767,6 +796,135 @@ > } > > static void >+resolve_cb (GnomeVFSDNSSDResolveHandle *handle, >+ GnomeVFSResult result, >+ const GnomeVFSDNSSDService *service, >+ const char *host, >+ int port, >+ const GHashTable *text, >+ int text_raw_len, >+ const char *text_raw, >+ gpointer callback_data) Nit: align after '(' on the resolve_cb line. >+ if (result != GNOME_VFS_OK) >+ return; Nit: on one line. >+ >+ if (text != NULL) { >+ path = g_hash_table_lookup ((GHashTable *) text, "path"); >+ } else { >+ path = "/"; >+ } Nit: code style is '{' on its own line. >+ //FIXME we need to add it to the bookmarks as well, otherwise >+ //it doesn't show up in the bookmark editor, but it will save it This is solved, right? >+ if (g_str_equal (ephy_node_get_property_string (ptr, EPHY_NODE_BMK_PROP_TITLE), service->name) != FALSE) { Just "if (...)", no need to test != FALSE here. >+ if (gnome_vfs_dns_sd_resolve (&reshandle, >+ service->name, service->type, service->domain, >+ 3000, >+ resolve_cb, >+ eb, >+ NULL) == GNOME_VFS_OK) { Introduce a #define'd constant for the '3000' timeout value. >+ eb->priv->resolve_list = g_list_append (eb->priv->resolve_list, g_list_prepend, please :) >+ l = eb->priv->resolve_list; >+ while (l != NULL) { >+ gnome_vfs_dns_sd_cancel_resolve (l->data); >+ l = l->next; >+ } g_list_foreach ?
Bastien: any chance you could have a look at this again? I'd like to get this before freeze :) Comment 13 contains a patch review and a few points that should be addressed. Thanks!
A bit of work would be required to make it apply again to current CVS HEAD, which I should be able to do. However, I still haven't figured out how to make the bookmark uneditable/unremovable/uncopiable.
Created attachment 48727 [details] [review] ephy-add-local-menu-5.patch
Thanks for the patch! +resolve_cb (GnomeVFSDNSSDResolveHandle *handle, [...] + g_value_init (&value, G_TYPE_INT); + g_value_set_int (&value, EPHY_NODE_SPECIAL_PRIORITY); + ephy_node_set_property (eb->priv->favorites, + EPHY_NODE_KEYWORD_PROP_PRIORITY, + &value); + g_value_unset (&value); I suppose you meant eb->priv->local here, but I still don't get what this is supposed to do; the priority is already set in ephy_bookmarks_init... I implemented drag disallowing, fixed it crashing on shutdown with no browse handler, and fixes saving. Since I have no local sites I cannot test this at all; could you please test and tell me if it all works: not allow drag of one of the local sites to another topic, not allow dragging other bookmarks to the local sites topic, but still allow dragging the local sites topic to the bookmarksbar?
Fixed the dragging checks, and tested.
Using mDNSPublish to create a service with a path: mDNSPublish "test" _http._tcp 80 path=/tmp mDNSBrowse shows the path: browse reply: Add Service 0x3 test _http._tcp. local. resolve reply: 0x3 test _http._tcp. local. 192.168.1.5 80 Txt: [path]=[/tmp] - (4 bytes) However, the path isn't being used in ephy. I don't know if the bug is in the ephy code, gnome-vfs or howl...
In src/bookmarks/ephy-bookmarks.c:resolve_cb() we get the patch from the hash table: 819 if (text != NULL) 820 { 821 path = g_hash_table_lookup ((GHashTable *) text, "path"); 822 } 823 else 824 { 825 path = "/"; However, the hashtable we get presented with is NULL !
+ Trace 61714
$1 = 0x8624400 "\tpath=/tmp" (gdb) p text $2 = (const GHashTable *) 0x0 Looks like a gnome-vfs bug to me: howl_resolve_idle always passes NULL as hashtable! [http://cvs.gnome.org/viewcvs/gnome-vfs/libgnomevfs/gnome-vfs-dns-sd.c]