summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2023-04-15 19:20:09 +0200
committerJens Georg <mail@jensge.org>2023-04-15 19:20:09 +0200
commitcea0df8f3cc9aed49c83e3e655d6518d37985ead (patch)
tree521d3212c8d00fae7a148a4820f86beafa4fe0fb
parentbdba10db542cde903d188b97e55a9ab2418bb3fd (diff)
downloadgupnp-cea0df8f3cc9aed49c83e3e655d6518d37985ead.tar.gz
service-proxy: Set reference to proxy earlier
Move it to prepare_action_msg so it is also available in sync calls, for handling authentication requests properly. Fixes #86
-rw-r--r--libgupnp/gupnp-service-proxy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index af5f254..24d2bdd 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -453,6 +453,10 @@ prepare_action_msg (GUPnPServiceProxy *proxy,
g_bytes_unref (body);
action->msg_str = NULL;
+ action->proxy = proxy;
+ g_object_add_weak_pointer (G_OBJECT (proxy),
+ (gpointer *) &(action->proxy));
+
return TRUE;
}
@@ -1599,9 +1603,6 @@ gupnp_service_proxy_call_action_async (GUPnPServiceProxy *proxy,
g_task_return_error (task, error);
g_object_unref (task);
} else {
- action->proxy = proxy;
- g_object_add_weak_pointer (G_OBJECT (proxy),
- (gpointer *) &(action->proxy));
gupnp_service_proxy_action_queue_task (task);
}
}