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 658486 - Initial events must always be sent, regardless of a instant unsubscribe
Initial events must always be sent, regardless of a instant unsubscribe
Status: RESOLVED FIXED
Product: GUPnP
Classification: Other
Component: gupnp
0.18.x
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-07 16:47 UTC by Jens Georg
Modified: 2011-11-16 13:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Always send initial event. (2.72 KB, patch)
2011-09-16 14:49 UTC, Jens Georg
none Details | Review
Always send initial event. (2.72 KB, patch)
2011-09-20 08:37 UTC, Jens Georg
none Details | Review
Always send initial event. (2.81 KB, patch)
2011-10-28 14:33 UTC, Jens Georg
needs-work Details | Review
Always send initial event. (2.95 KB, patch)
2011-11-01 08:14 UTC, Jens Georg
needs-work Details | Review
Always send initial event. (3.14 KB, patch)
2011-11-02 09:51 UTC, Jens Georg
committed Details | Review

Description Jens Georg 2011-09-07 16:47:49 UTC
cf UDA 1.1 document, section 4.1.1 (page 88):

This initial event message is always sent, even if the control point unsubscribes before it is delivered. The device MUST insure that the control point has received the response to the subscription request before sending the initial event message, to insure that the control point has received the SID (subscription ID) and can thereby correlate the event message to the subscription.

Somehow it is currently possible to send SUBSCRIBE/UNSUBSCRIBE fast enough such that the initial eventing is skipped.
Comment 1 Jens Georg 2011-09-16 14:49:54 UTC
Created attachment 196734 [details] [review]
Always send initial event.

If client unsubscribes before the initial event could be sent, mark the
subscribtion as "to delete later" and send the event nevertheless.

The subscription will then be deleted before the next notification.
Comment 2 Jens Georg 2011-09-20 08:37:50 UTC
Created attachment 197021 [details] [review]
Always send initial event.

If client unsubscribes before the initial event could be sent, mark the
subscribtion as "to delete later" and send the event nevertheless.

The subscription will then be deleted before the next notification.
Comment 3 Jens Georg 2011-09-20 09:41:55 UTC
Comment on attachment 197021 [details] [review]
Always send initial event.

Hm, that seems to have issues. Will re-check
Comment 4 Jens Georg 2011-10-28 14:33:35 UTC
Created attachment 200173 [details] [review]
Always send initial event.

If client unsubscribes before the initial event could be sent, mark the
subscribtion as "to delete later" and send the event nevertheless.

The subscription will then be deleted before the next notification.
Comment 5 Jens Georg 2011-10-31 17:17:45 UTC
Review of attachment 200173 [details] [review]:

::: libgupnp/gupnp-service.c
@@ +1135,3 @@
         notify_subscriber (data->sid, data, mem);
 
+        data->initial_state_send = TRUE;

This is stupid, that needs to go in the call-back func.

@@ +1259,3 @@
+        data = g_hash_table_lookup (service->priv->subscriptions, sid);
+        if (data) {
+                if (data->initial_state_send)

Use proper coding-style!
Comment 6 Jens Georg 2011-11-01 08:14:01 UTC
Created attachment 200384 [details] [review]
Always send initial event.

If client unsubscribes before the initial event could be sent, mark the
subscribtion as "to delete later" and send the event nevertheless.

The subscription will then be deleted before the next notification.
Comment 7 Jens Georg 2011-11-02 09:49:10 UTC
Review of attachment 200384 [details] [review]:

::: libgupnp/gupnp-service.c
@@ +1381,2 @@
                 send_initial_state ((SubscriptionData *) data);
+                if (((SubscriptionData *)data)->to_delete)

That needs to check if initial event has been sent, we don't keep retrying when the sending fails
Comment 8 Jens Georg 2011-11-02 09:51:38 UTC
Created attachment 200484 [details] [review]
Always send initial event.

If client unsubscribes before the initial event could be sent, mark the
subscribtion as "to delete later" and send the event nevertheless.

The subscription will then be deleted before the next notification.
Comment 9 Jens Georg 2011-11-02 09:54:19 UTC
Review of attachment 200484 [details] [review]:

::: libgupnp/gupnp-service.c
@@ +99,3 @@
         GList        *pending_messages; /* Pending SoupMessages from this
                                            subscription */
+        gboolean      initial_state_send;

_send -> _sent (proper tense)
Comment 10 Jens Georg 2011-11-16 13:27:27 UTC
Attachment 200484 [details] pushed as ed353b0 - Always send initial event.