diff options
author | Rob Bradford <rob@linux.intel.com> | 2008-09-04 17:01:04 +0100 |
---|---|---|
committer | Rob Bradford <rob@linux.intel.com> | 2008-09-04 17:05:25 +0100 |
commit | f2317e1bb91ac3625deb68a60375dbb66ef45257 (patch) | |
tree | b376253a715a5d658f452c6ad85b843f831020b8 /rest/rest-proxy-call.c | |
parent | b15d5f5824abd662bc591eef6ffa9a452061a10e (diff) |
Implement rest_proxy_call_run
Diffstat (limited to 'rest/rest-proxy-call.c')
-rw-r--r-- | rest/rest-proxy-call.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index 11102f4..c5053a1 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -414,12 +414,47 @@ rest_proxy_call_async (RestProxyCall *call, return TRUE; } +static void +_rest_proxy_call_async_cb (RestProxyCall *call, + GObject *weak_object, + gpointer userdata) +{ + GMainLoop *loop = (GMainLoop *)userdata; + + g_main_loop_quit (loop); +} + gboolean rest_proxy_call_run (RestProxyCall *call, - GMainLoop **loop, - GError **error) + GMainLoop **loop_out, + GError **error_out) { - return FALSE; + GMainLoop *loop; + gboolean res = TRUE; + GError *error = NULL; + + loop = g_main_loop_new (NULL, FALSE); + + if (loop_out) + *loop_out = loop; + + res = rest_proxy_call_async (call, + _rest_proxy_call_async_cb, + NULL, + loop, + &error); + + if (!res) + { + g_propagate_error (error_out, error); + goto error; + } + + g_main_loop_run (loop); + +error: + g_main_loop_unref (loop); + return res; } void |