summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2010-08-12 15:36:32 +0100
committerRob Bradford <rob@linux.intel.com>2010-08-12 15:40:51 +0100
commited45f7103124fb802f913618faf65d0e60bf1725 (patch)
treee6be1de89b1ef2696f19dc20a0983c7550af868c
parent17c5d2f3407c108c680b672c52df7fc4919548d6 (diff)
downloadlibrest-ed45f7103124fb802f913618faf65d0e60bf1725.tar.gz
proxy-call: Adjust to the new callback always fired invariant (since d7d4d52)
Since the callback is always fired when the call is completed, cancelled or an error situation. We need to adapt the code for rest_proxy_call_cancel so that it doesn't unref the call object a second time.
-rw-r--r--rest/rest-proxy-call.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c
index 3517a56..007fd25 100644
--- a/rest/rest-proxy-call.c
+++ b/rest/rest-proxy-call.c
@@ -504,9 +504,9 @@ rest_proxy_call_get_params (RestProxyCall *call)
static void _call_async_weak_notify_cb (gpointer *data,
GObject *dead_object);
-static void _call_async_finished_cb (SoupSession *session,
- SoupMessage *message,
- gpointer userdata);
+static void _call_message_completed_cb (SoupSession *session,
+ SoupMessage *message,
+ gpointer userdata);
static void
_populate_headers_hash_table (const gchar *name,
@@ -592,9 +592,9 @@ finish_call (RestProxyCall *call, SoupMessage *message, GError **error)
}
static void
-_call_async_finished_cb (SoupSession *session,
- SoupMessage *message,
- gpointer userdata)
+_call_message_completed_cb (SoupSession *session,
+ SoupMessage *message,
+ gpointer userdata)
{
RestProxyCallAsyncClosure *closure;
RestProxyCall *call;
@@ -806,7 +806,7 @@ rest_proxy_call_async (RestProxyCall *call,
_rest_proxy_queue_message (priv->proxy,
message,
- _call_async_finished_cb,
+ _call_message_completed_cb,
closure);
g_free (priv->url);
priv->url = NULL;
@@ -838,18 +838,11 @@ rest_proxy_call_cancel (RestProxyCall *call)
if (closure)
{
- /* Remove the "finished" signal handler on the message */
- g_signal_handlers_disconnect_by_func (closure->message,
- _call_async_finished_cb,
- closure);
-
+ /* This will cause the _call_message_completed_cb to be fired which will
+ * tidy up the closure and so forth */
_rest_proxy_cancel_message (priv->proxy, closure->message);
-
- g_object_unref (closure->call);
- g_slice_free (RestProxyCallAsyncClosure, closure);
}
- priv->cur_call_closure = NULL;
return TRUE;
}