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 673150 - Searching for versioned resources does not work properly
Searching for versioned resources does not work properly
Status: RESOLVED FIXED
Product: gssdp
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-30 09:15 UTC by Jens Georg
Modified: 2019-02-22 09:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Add regression test for bgo#673150 (4.36 KB, patch)
2012-03-30 11:13 UTC, Jens Georg
none Details | Review
Don't ignore higher version alive announcements (4.76 KB, patch)
2012-03-30 12:08 UTC, Jens Georg
none Details | Review
tests: Add regression test for bgo#673150 (5.54 KB, patch)
2012-04-02 16:22 UTC, Jens Georg
committed Details | Review
tests: Add some functional tests (22.59 KB, patch)
2012-04-02 16:22 UTC, Jens Georg
committed Details | Review
Ignore announcements from services with a lower version (3.00 KB, patch)
2012-04-02 16:22 UTC, Jens Georg
none Details | Review
Make internal resource cache version-independant (3.97 KB, patch)
2012-04-02 16:22 UTC, Jens Georg
committed Details | Review
Ignore announcements from services with a lower version (3.11 KB, patch)
2012-04-03 17:29 UTC, Jens Georg
committed Details | Review

Description Jens Georg 2012-03-30 09:15:35 UTC
If you create a new control point with the target urn:schemas-upnp-org:device:MediaServer:1 the control-point will send the proxy-unavailable signal after max-age seconds for devices that implement MediaServer:2 or higher.

The reason is that the initial time-out is set for an USN with the version searched for since UDA 1.0, 1.2.2 requires to reply with the requested version, but later alive announcements only use the highest version (as required by UDA 1.0, 1.1.2)

So the USN cache never matches and the time-out set-up by the search response is never cleared, declaring the device unavailable.
Comment 1 Jens Georg 2012-03-30 09:22:04 UTC
That's basically the other side of ad16c1ab2e14c8736bbef0397667ad782dc8d218
Comment 2 Jens Georg 2012-03-30 11:13:45 UTC
Created attachment 210942 [details] [review]
tests: Add regression test for bgo#673150
Comment 3 Jens Georg 2012-03-30 12:08:34 UTC
Created attachment 210949 [details] [review]
Don't ignore higher version alive announcements

Previously if a ResourceBrowser was searching for e.g. MediaServer:1
but a device supporting MediaServer:2 replied to the search request, a
cache entry with MediaServer:1 (the device rightfully replying with
that version as required by UDA) was generated and a resource timeout
was set up. However, subsequent alive announcements from that service
resulted in a cache miss since it announces MediaServer:2 only as
required by the UDA document.
Comment 4 Jens Georg 2012-03-30 12:10:43 UTC
Review of attachment 210949 [details] [review]:

::: libgssdp/gssdp-resource-browser.c
@@ +635,3 @@
+                pivot = strrchr (usn, ':');
+                if (pivot != NULL)
+                        *pivot = '\0';

I'm not super-happy about this, suggestions welcome.
Comment 5 Jens Georg 2012-03-30 12:15:57 UTC
Forgot to modify resource_unavailable as well :-/
Comment 6 Jens Georg 2012-04-02 09:58:52 UTC
Comment on attachment 210949 [details] [review]
Don't ignore higher version alive announcements

That patch is broken
Comment 7 Jens Georg 2012-04-02 16:22:05 UTC
Created attachment 211145 [details] [review]
tests: Add regression test for bgo#673150
Comment 8 Jens Georg 2012-04-02 16:22:12 UTC
Created attachment 211146 [details] [review]
tests: Add some functional tests
Comment 9 Jens Georg 2012-04-02 16:22:16 UTC
Created attachment 211147 [details] [review]
Ignore announcements from services with a lower version
Comment 10 Jens Georg 2012-04-02 16:22:20 UTC
Created attachment 211148 [details] [review]
Make internal resource cache version-independant
Comment 11 Jens Georg 2012-04-03 17:29:40 UTC
Created attachment 211239 [details] [review]
Ignore announcements from services with a lower version

Fix two leaks
Comment 12 Jens Georg 2012-05-03 08:57:02 UTC
Attachment 211146 [details] pushed as 445d02f - tests: Add some functional tests
Attachment 211148 [details] pushed as 4ad03dc - Make internal resource cache version-independant
Attachment 211239 [details] pushed as 612a8d9 - Ignore announcements from services with a lower version
Comment 13 Mark Ryan 2012-05-04 07:50:35 UTC
Commit 612a8d9 seems to introduce two memory leaks in check_target_compat.  This function returns at lines 852 and 855 without calling g_match_info_free.
Comment 14 Jens Georg 2012-05-04 08:12:31 UTC
ehm true.
Comment 15 Jens Georg 2012-05-04 08:19:55 UTC
Fixed