[libsoup] Fix Request-Line in https over proxy



commit d45a4b19a00c76ccbcf9b114a9185067402dc14d
Author: Dan Winship <danw gnome org>
Date:   Fri Nov 6 12:52:14 2009 -0500

    Fix Request-Line in https over proxy
    
    Previously it was continuing to send a full URI rather than only a path
    in the Request-Line after completing the CONNECT, which confused some
    (broken) servers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=598277
    https://bugzilla.gnome.org/show_bug.cgi?id=600826

 libsoup/soup-session.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 8fb28ec..fc6f524 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1048,8 +1048,10 @@ soup_session_connection_failed (SoupSession *session,
 }
 
 static void
-tunnel_connected (SoupSession *session, SoupMessage *msg, gpointer user_data)
+tunnel_connected (SoupMessage *msg, gpointer user_data)
 {
+	SoupSession *session = user_data;
+
 	if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) {
 		SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
 		SoupMessageQueueItem *item =
@@ -1061,6 +1063,7 @@ tunnel_connected (SoupSession *session, SoupMessage *msg, gpointer user_data)
 		g_object_set (item->conn,
 			      SOUP_CONNECTION_PROXY_URI, NULL,
 			      NULL);
+		soup_message_queue_item_unref (item);
 	}
 }
 
@@ -1084,9 +1087,13 @@ soup_session_make_connect_message (SoupSession *session,
 
 	/* Call the base implementation of soup_session_queue_message
 	 * directly, to add msg to the SoupMessageQueue and cause all
-	 * the right signals to be emitted.
+	 * the right signals to be emitted. We can't use
+	 * queue_message's callback arg in this case because that's
+	 * actually implemented by the subclasses.
 	 */
-	queue_message (session, msg, tunnel_connected, NULL);
+	g_signal_connect (msg, "finished",
+			  G_CALLBACK (tunnel_connected), session);
+	queue_message (session, msg, NULL, NULL);
 	item = soup_message_queue_lookup (priv->queue, msg);
 	g_object_unref (msg);
 	return item;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]