GNOME Bugzilla – Bug 658486
Initial events must always be sent, regardless of a instant unsubscribe
Last modified: 2011-11-16 13:27:31 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.
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.
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 on attachment 197021 [details] [review] Always send initial event. Hm, that seems to have issues. Will re-check
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.
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!
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.
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
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.
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)
Attachment 200484 [details] pushed as ed353b0 - Always send initial event.