soup-message-io: clear connection from queue items when IDLE status is set
authorSergio Villar Senin <svillar@igalia.com>
Thu, 26 May 2011 13:27:37 +0000 (15:27 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 8 Jun 2011 06:47:36 +0000 (08:47 +0200)
Do not reuse the SoupConnection we used for the first time when
a SoupMessage gets redirected as it could have been assigned to a different
SoupMessage meanwhile.

https://bugzilla.gnome.org/show_bug.cgi?id=651146

libsoup/soup-message-io.c

index 290d781..c7da2c8 100644 (file)
@@ -146,8 +146,11 @@ soup_message_io_stop (SoupMessage *msg)
 
        if (io->read_state < SOUP_MESSAGE_IO_STATE_FINISHING)
                soup_socket_disconnect (io->sock);
-       else if (io->item && io->item->conn)
+       else if (io->item && io->item->conn) {
                soup_connection_set_state (io->item->conn, SOUP_CONNECTION_IDLE);
+               g_object_unref (io->item->conn);
+               io->item->conn = NULL;
+       }
 }
 
 #define SOUP_MESSAGE_IO_EOL            "\r\n"