[libsoup/gnome-3-2] SoupSession: set the connection to IDLE on unqueuing SoupMessages
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/gnome-3-2] SoupSession: set the connection to IDLE on unqueuing SoupMessages
- Date: Thu, 29 Sep 2011 14:45:39 +0000 (UTC)
commit a1078067cf007e46a38c6f441496a25f8ad36acd
Author: Sergio Villar Senin <svillar igalia com>
Date: Mon Sep 26 19:09:31 2011 +0200
SoupSession: set the connection to IDLE on unqueuing SoupMessages
Connection should be set to IDLE state only after being 100% sure that is
not going to be reused by the current owner.
Also, fix a bug in SoupSessionSync revealed by this change.
https://bugzilla.gnome.org/show_bug.cgi?id=651146
libsoup/soup-message-io.c | 2 --
libsoup/soup-session-sync.c | 2 +-
libsoup/soup-session.c | 1 +
3 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/libsoup/soup-message-io.c b/libsoup/soup-message-io.c
index 59b75d8..a489788 100644
--- a/libsoup/soup-message-io.c
+++ b/libsoup/soup-message-io.c
@@ -144,8 +144,6 @@ 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)
- soup_connection_set_state (io->item->conn, SOUP_CONNECTION_IDLE);
}
#define SOUP_MESSAGE_IO_EOL "\r\n"
diff --git a/libsoup/soup-session-sync.c b/libsoup/soup-session-sync.c
index 373b1bd..7a42e46 100644
--- a/libsoup/soup-session-sync.c
+++ b/libsoup/soup-session-sync.c
@@ -153,7 +153,7 @@ tunnel_connect (SoupSession *session, SoupMessageQueueItem *related)
soup_session_send_queue_item (session, item, NULL);
status = item->msg->status_code;
if (item->state == SOUP_MESSAGE_RESTARTING &&
- soup_connection_get_state (conn) != SOUP_CONNECTION_DISCONNECTED) {
+ soup_message_io_in_progress (item->msg)) {
item->state = SOUP_MESSAGE_STARTING;
soup_message_restarted (item->msg);
} else {
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 3fc37fd..862bf4b 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1499,6 +1499,7 @@ soup_session_unqueue_item (SoupSession *session,
SoupSessionHost *host;
if (item->conn) {
+ soup_connection_set_state (item->conn, SOUP_CONNECTION_IDLE);
g_object_unref (item->conn);
item->conn = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]