summaryrefslogtreecommitdiff
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
parent92e1871d3181a73a780f588689733f25e3df5b48 (diff)
Add a sync SoupSession to RestProxy and expose _send_message
-rw-r--r--rest/rest-private.h2
-rw-r--r--rest/rest-proxy.c19
2 files changed, 21 insertions, 0 deletions
diff --git a/rest/rest-private.h b/rest/rest-private.h
index 444bf09..5fb25b4 100644
--- a/rest/rest-private.h
+++ b/rest/rest-private.h
@@ -54,5 +54,7 @@ void _rest_proxy_queue_message (RestProxy *proxy,
SoupMessage *message);
void _rest_proxy_cancel_message (RestProxy *proxy,
SoupMessage *message);
+guint _rest_proxy_send_message (RestProxy *proxy,
+ SoupMessage *message);
G_END_DECLS
#endif /* _REST_PRIVATE */
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);
+}