summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2014-02-17 10:05:36 -0500
committerDan Winship <danw@gnome.org>2014-02-17 11:43:40 -0500
commit3c4cea7bcc7dd44d61bf1d87a4ec8dce99a875cf (patch)
tree511ad5b66f9dda6a2bd3c53a9b0ed633640e5d97
parentc92ef5cf5fc71d6cd6c29c87a258561b8a525d2b (diff)
downloadlibsoup-3c4cea7bcc7dd44d61bf1d87a4ec8dce99a875cf.tar.gz
SoupConnection: Explicitly set SoupAddress protocol.
So GProxyResolver can distinguish between "http" and "https" requests, and choose the appropriate proxy settings. Previously the SoupAddress protocol was left unset, so soup_address_connectable_proxy_enumerate() assumed "http". https://bugzilla.gnome.org/show_bug.cgi?id=724316
-rw-r--r--libsoup/soup-connection.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c
index 2b5dc49e..fce589fa 100644
--- a/libsoup/soup-connection.c
+++ b/libsoup/soup-connection.c
@@ -532,8 +532,14 @@ soup_connection_connect_async (SoupConnection *conn,
soup_connection_set_state (conn, SOUP_CONNECTION_CONNECTING);
- remote_addr = soup_address_new (priv->remote_uri->host,
- priv->remote_uri->port);
+ /* Set the protocol to ensure correct proxy resolution. */
+ remote_addr =
+ g_object_new (SOUP_TYPE_ADDRESS,
+ SOUP_ADDRESS_NAME, priv->remote_uri->host,
+ SOUP_ADDRESS_PORT, priv->remote_uri->port,
+ SOUP_ADDRESS_PROTOCOL, priv->remote_uri->scheme,
+ NULL);
+
priv->socket =
soup_socket_new (SOUP_SOCKET_REMOTE_ADDRESS, remote_addr,
SOUP_SOCKET_SSL_CREDENTIALS, priv->tlsdb,
@@ -583,7 +589,14 @@ soup_connection_connect_sync (SoupConnection *conn,
soup_connection_set_state (conn, SOUP_CONNECTION_CONNECTING);
- remote_addr = soup_address_new (priv->remote_uri->host, priv->remote_uri->port);
+ /* Set the protocol to ensure correct proxy resolution. */
+ remote_addr =
+ g_object_new (SOUP_TYPE_ADDRESS,
+ SOUP_ADDRESS_NAME, priv->remote_uri->host,
+ SOUP_ADDRESS_PORT, priv->remote_uri->port,
+ SOUP_ADDRESS_PROTOCOL, priv->remote_uri->scheme,
+ NULL);
+
priv->socket =
soup_socket_new (SOUP_SOCKET_REMOTE_ADDRESS, remote_addr,
SOUP_SOCKET_PROXY_RESOLVER, priv->proxy_resolver,