After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692516 - Rescan feature needed in GSSDP
Rescan feature needed in GSSDP
Status: RESOLVED FIXED
Product: gssdp
Classification: Other
Component: General
0.19.x
Other All
: Normal normal
: ---
Assigned To: Krzesimir Nowak
GUPnP Maintainers
ivi
Depends on:
Blocks:
 
 
Reported: 2013-01-25 10:38 UTC by Mark Ryan
Modified: 2019-02-22 09:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds a rescan function to GSSDPResourceBrowser (7.35 KB, patch)
2013-02-18 15:58 UTC, Krzesimir Nowak
needs-work Details | Review
Quick and dirty patch adding rescan button to gupnp-av-cp (4.96 KB, patch)
2013-02-18 16:01 UTC, Krzesimir Nowak
committed Details | Review
Adds a rescan function to GSSDPResourceBrowser v2 (7.88 KB, patch)
2013-02-20 09:51 UTC, Krzesimir Nowak
committed Details | Review

Description Mark Ryan 2013-01-25 10:38:06 UTC
It is currently not possible for GSSDP clients, such as a DMP, to easily force a rescan of the local area network.  They may want to do this to discover new UPnP devices or to detect that existing devices are no longer available.  Normally, such scans should not be necessary as devices should send alive and bye messages when they leave and join a network but it's always possible for these messages to get lost or to not be sent.  For this reason, the ability to force a rescan is useful.  I believe this feature would also be useful for certification as well.

The only way to perform a rescan at the moment with GSSDP is to call gssdp_resource_browser_set_active twice, once with a value of FALSE, the second with TRUE.  Unfortunately, this has the effect of removing and re-adding all the existing devices, which may not be what the user wants, particularly if  outstanding commands have been issued on those devices.  

The solution would be to add a new method that issues a rescan without clearing the SSDP cache.   Timers may be needed to remove devices from the cache that do not respond to the rescan in a reasonable amount of time.
Comment 1 Krzesimir Nowak 2013-02-18 15:58:50 UTC
Created attachment 236618 [details] [review]
Adds a rescan function to GSSDPResourceBrowser
Comment 2 Krzesimir Nowak 2013-02-18 16:01:02 UTC
Created attachment 236620 [details] [review]
Quick and dirty patch adding rescan button to gupnp-av-cp

This patch is not meant to be a part of this bug - I made it for me to test the rescan feature.

Unfortunately I don't have a service that doesn't announce itself.

I would be grateful for some testing of it.
Comment 3 Jens Georg 2013-02-18 16:29:57 UTC
It's easy to simulate with ctrl-c-ing the fullscreen renderer I think
Comment 4 Krzesimir Nowak 2013-02-19 07:27:09 UTC
I simulated it with killing Rygel with SIGKILL instead. Fullscreen renderer as a standalone app does not show up in the renderers combo.
Comment 5 Krzesimir Nowak 2013-02-19 07:30:44 UTC
Well, fullscreen renderer shows up. I just forgot to pass network interface when executing it. Works with it as well.
Comment 6 Jens Georg 2013-02-20 08:23:48 UTC
(In reply to comment #5)
> Well, fullscreen renderer shows up. I just forgot to pass network interface
> when executing it. Works with it as well.

Hm, good point. that needs an error message or a default.
Comment 7 Jens Georg 2013-02-20 08:34:18 UTC
Review of attachment 236618 [details] [review]:

Some minor nitpicks, otherwise fine.

::: libgssdp/gssdp-resource-browser.c
@@ +42,3 @@
 #include "gssdp-marshal.h"
 
+#define REASONABLE_AMOUNT_OF_TIME 5 /* 5 seconds */

Can we just call that RESCAN_TIMEOUT or something?

@@ +599,3 @@
+ **/
+gboolean
+ * Begins discovery if @resource_browser is active and no discovery is

Function is missing from gtk-doc magic files

@@ +1112,3 @@
+        /* Setup a set of responsive resources for cache refreshing */
+        resource_browser->priv->fresh_resources = g_hash_table_new_full
+                                        (g_str_hash,

Indenting is off, probably tabs vs. spaces.
Comment 8 Krzesimir Nowak 2013-02-20 09:32:48 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Well, fullscreen renderer shows up. I just forgot to pass network interface
> > when executing it. Works with it as well.
> 
> Hm, good point. that needs an error message or a default.

It has a default - eth0. I just forgot that this program takes any parameters. I had to pass "lo".
Comment 9 Krzesimir Nowak 2013-02-20 09:50:25 UTC
(In reply to comment #7)
> Review of attachment 236618 [details] [review]:
> 
> Some minor nitpicks, otherwise fine.
> 
> ::: libgssdp/gssdp-resource-browser.c
> @@ +42,3 @@
>  #include "gssdp-marshal.h"
> 
> +#define REASONABLE_AMOUNT_OF_TIME 5 /* 5 seconds */
> 
> Can we just call that RESCAN_TIMEOUT or something?

Renamed.

> @@ +599,3 @@
> + **/
> +gboolean
> + * Begins discovery if @resource_browser is active and no discovery is
> 
> Function is missing from gtk-doc magic files

Added to sections file.

> @@ +1112,3 @@
> +        /* Setup a set of responsive resources for cache refreshing */
> +        resource_browser->priv->fresh_resources = g_hash_table_new_full
> +                                        (g_str_hash,
> 
> Indenting is off, probably tabs vs. spaces.

That's actually an indenting rule of GUPnP stack.
Comment 10 Krzesimir Nowak 2013-02-20 09:51:10 UTC
Created attachment 236902 [details] [review]
Adds a rescan function to GSSDPResourceBrowser v2
Comment 11 Jens Georg 2013-02-20 10:26:23 UTC
Review of attachment 236902 [details] [review]:

Thanks. gaam
Comment 12 Jens Georg 2013-02-20 10:26:37 UTC
Review of attachment 236620 [details] [review]:

Fine, Commit after the other patch