summaryrefslogtreecommitdiff
path: root/rest/rest-proxy.c
diff options
context:
space:
mode:
authorRoss Burton <ross@linux.intel.com>2009-05-11 17:34:35 +0100
committerRoss Burton <ross@linux.intel.com>2009-05-29 15:35:15 +0100
commit30c5fab6a57641b05ae03f258134edbf27d4033b (patch)
treea6106dbee6e840f014cbe0ef6bde4b43d1e95792 /rest/rest-proxy.c
parent92e1871d3181a73a780f588689733f25e3df5b48 (diff)
downloadlibrest-30c5fab6a57641b05ae03f258134edbf27d4033b.tar.gz
Add a sync SoupSession to RestProxy and expose _send_message
Diffstat (limited to 'rest/rest-proxy.c')
-rw-r--r--rest/rest-proxy.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/rest/rest-proxy.c b/rest/rest-proxy.c
index 54f9e2f..76623f2 100644
--- a/rest/rest-proxy.c
+++ b/rest/rest-proxy.c
@@ -44,6 +44,7 @@ struct _RestProxyPrivate {
gchar *user_agent;
gboolean binding_required;
SoupSession *session;
+ SoupSession *session_sync;
};
enum
@@ -140,6 +141,12 @@ rest_proxy_dispose (GObject *object)
g_object_unref (priv->session);
priv->session = NULL;
}
+
+ if (priv->session_sync)
+ {
+ g_object_unref (priv->session_sync);
+ priv->session_sync = NULL;
+ }
}
static void
@@ -209,9 +216,12 @@ rest_proxy_init (RestProxy *self)
RestProxyPrivate *priv = GET_PRIVATE (self);
priv->session = soup_session_async_new ();
+ priv->session_sync = soup_session_sync_new ();
#if WITH_GNOME
soup_session_add_feature_by_type (priv->session,
SOUP_TYPE_PROXY_RESOLVER_GNOME);
+ soup_session_add_feature_by_type (priv->session_sync,
+ SOUP_TYPE_PROXY_RESOLVER_GNOME);
#endif
if (REST_DEBUG_ENABLED(PROXY)) {
@@ -425,3 +435,12 @@ _rest_proxy_cancel_message (RestProxy *proxy,
message,
SOUP_STATUS_CANCELLED);
}
+
+guint
+_rest_proxy_send_message (RestProxy *proxy,
+ SoupMessage *message)
+{
+ RestProxyPrivate *priv = GET_PRIVATE (proxy);
+
+ return soup_session_send_message (priv->session_sync, message);
+}