diff options
author | Sven Neumann <neumann@teufel.de> | 2014-10-08 13:03:08 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2014-10-25 10:30:27 +0200 |
commit | 20eed980f64a0042e6bfc340c80d982ddf04ff1c (patch) | |
tree | 028f11d77767944cc8ac3742bb2e4e036fe49477 | |
parent | a220f71572a34b6ea5022d8441b9d251dee24abc (diff) | |
download | gupnp-20eed980f64a0042e6bfc340c80d982ddf04ff1c.tar.gz |
gupnp-service-proxy: remove subscription timeout on subscribe
We have seen crashes in subscription_expire() where user_data
pointed to invalid memory. I do not see an obvious way how this
can have happened, but it seems like a good idea to always
remove the subscription timeout when sending a new subscription
request.
Signed-off-by: Sven Neumann <neumann@teufel.de>
-rw-r--r-- | libgupnp/gupnp-service-proxy.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c index 7a48ac9..015e926 100644 --- a/libgupnp/gupnp-service-proxy.c +++ b/libgupnp/gupnp-service-proxy.c @@ -2278,7 +2278,13 @@ subscribe (GUPnPServiceProxy *proxy) const char *server_url; char *sub_url, *delivery_url, *timeout; - context = gupnp_service_info_get_context (GUPNP_SERVICE_INFO (proxy)); + /* Remove subscription timeout */ + if (proxy->priv->subscription_timeout_src) { + g_source_destroy (proxy->priv->subscription_timeout_src); + proxy->priv->subscription_timeout_src = NULL; + } + + context = gupnp_service_info_get_context (GUPNP_SERVICE_INFO (proxy)); /* Create subscription message */ sub_url = gupnp_service_info_get_event_subscription_url |