diff options
author | Ross Burton <ross@linux.intel.com> | 2010-05-14 10:34:36 +0100 |
---|---|---|
committer | Ross Burton <ross@linux.intel.com> | 2010-05-14 10:34:36 +0100 |
commit | d7d4d52ca31a8101ce9ce125449b5ff58e47d501 (patch) | |
tree | 984a791f3a69c29a56cb15526b8cc4b8c8969dc6 | |
parent | 1da71cc919d1900c1f4c67c1ae722ed9cf505271 (diff) | |
download | librest-d7d4d52ca31a8101ce9ce125449b5ff58e47d501.tar.gz |
Use the session callback instead of finished (BMC#842)
Use the completed callback in soup_session_queue_message instead of connecting
to finished on the message itself. I'm not entirely why the behaviour is
different but this fixes #842 where an async call make inside another async call
would end up with the original message "finishing" again, causing infinite
loops.
-rw-r--r-- | rest/rest-private.h | 4 | ||||
-rw-r--r-- | rest/rest-proxy-call.c | 16 | ||||
-rw-r--r-- | rest/rest-proxy.c | 10 |
3 files changed, 17 insertions, 13 deletions
diff --git a/rest/rest-private.h b/rest/rest-private.h index 5fb25b4..400ead2 100644 --- a/rest/rest-private.h +++ b/rest/rest-private.h @@ -51,7 +51,9 @@ void _rest_setup_debugging (void); gboolean _rest_proxy_get_binding_required (RestProxy *proxy); const gchar *_rest_proxy_get_bound_url (RestProxy *proxy); void _rest_proxy_queue_message (RestProxy *proxy, - SoupMessage *message); + SoupMessage *message, + SoupSessionCallback callback, + gpointer user_data); void _rest_proxy_cancel_message (RestProxy *proxy, SoupMessage *message); guint _rest_proxy_send_message (RestProxy *proxy, diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index 271492a..06ad607 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -492,7 +492,8 @@ 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 (SoupMessage *message, +static void _call_async_finished_cb (SoupSession *session, + SoupMessage *message, gpointer userdata); static void @@ -579,7 +580,8 @@ finish_call (RestProxyCall *call, SoupMessage *message, GError **error) } static void -_call_async_finished_cb (SoupMessage *message, +_call_async_finished_cb (SoupSession *session, + SoupMessage *message, gpointer userdata) { RestProxyCallAsyncClosure *closure; @@ -753,12 +755,10 @@ rest_proxy_call_async (RestProxyCall *call, closure); } - g_signal_connect (message, - "finished", - (GCallback)_call_async_finished_cb, - closure); - - _rest_proxy_queue_message (priv->proxy, message); + _rest_proxy_queue_message (priv->proxy, + message, + _call_async_finished_cb, + closure); g_free (priv->url); priv->url = NULL; return TRUE; diff --git a/rest/rest-proxy.c b/rest/rest-proxy.c index 92a1bfc..a59b260 100644 --- a/rest/rest-proxy.c +++ b/rest/rest-proxy.c @@ -433,7 +433,9 @@ rest_proxy_simple_run (RestProxy *proxy, void _rest_proxy_queue_message (RestProxy *proxy, - SoupMessage *message) + SoupMessage *message, + SoupSessionCallback callback, + gpointer user_data) { RestProxyPrivate *priv; @@ -443,9 +445,9 @@ _rest_proxy_queue_message (RestProxy *proxy, priv = GET_PRIVATE (proxy); soup_session_queue_message (priv->session, - message, - NULL, - NULL); + message, + callback, + user_data); } void |