diff options
author | Dan Winship <danw@gnome.org> | 2010-06-09 14:34:50 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2010-06-09 14:34:50 -0400 |
commit | ceceaa912cd02660eecacd52d9a1ffc4d15c3c00 (patch) | |
tree | 12544225f7c23c72011c77a7e525daceadd51dde /libsoup/soup-connection.c | |
parent | b5543c970e75ecea0215d6641b772f3bc8a49075 (diff) | |
download | libsoup-ceceaa912cd02660eecacd52d9a1ffc4d15c3c00.tar.gz |
Fix connection states so in-use connections don't get pruned
Since connections are assigned to messages before they're connected
now, they should go to IN_USE after connecting, not IDLE. Otherwise
the idle-connection-closing code might close connections that existing
queue items were planning to use.
Diffstat (limited to 'libsoup/soup-connection.c')
-rw-r--r-- | libsoup/soup-connection.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c index 159d5704..c9a48410 100644 --- a/libsoup/soup-connection.c +++ b/libsoup/soup-connection.c @@ -446,7 +446,7 @@ socket_connect_result (SoupSocket *sock, guint status, gpointer user_data) g_signal_connect (priv->socket, "disconnected", G_CALLBACK (socket_disconnected), data->conn); - soup_connection_set_state (data->conn, SOUP_CONNECTION_IDLE); + soup_connection_set_state (data->conn, SOUP_CONNECTION_IN_USE); priv->unused_timeout = time (NULL) + SOUP_CONNECTION_UNUSED_TIMEOUT; start_idle_timer (data->conn); @@ -529,7 +529,7 @@ soup_connection_connect_sync (SoupConnection *conn, GCancellable *cancellable) } if (SOUP_STATUS_IS_SUCCESSFUL (status)) { - soup_connection_set_state (conn, SOUP_CONNECTION_IDLE); + soup_connection_set_state (conn, SOUP_CONNECTION_IN_USE); priv->unused_timeout = time (NULL) + SOUP_CONNECTION_UNUSED_TIMEOUT; start_idle_timer (conn); } else { |