From 3c4cea7bcc7dd44d61bf1d87a4ec8dce99a875cf Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 17 Feb 2014 10:05:36 -0500 Subject: 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 --- libsoup/soup-connection.c | 19 ++++++++++++++++--- 1 file 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, -- cgit v1.2.1