summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2009-08-20 14:14:52 -0400
committerDan Winship <danw@gnome.org>2009-08-20 14:16:35 -0400
commit53095c541d677d0b6f96fc9becca1c1329c37975 (patch)
treef0006f8222bf2108b17e82bf92662da8caf8de68
parent373d0a5508a0f8edd93a784899f805f6352d227b (diff)
downloadlibsoup-53095c541d677d0b6f96fc9becca1c1329c37975.tar.gz
Fix the definition of soup_message_is_keepalive() for HTTP/1.0
Fixes a problem where some requests would reach 100% but never "finish"
-rw-r--r--libsoup/soup-message.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index 1f0c8acb..020577ab 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -1369,14 +1369,13 @@ soup_message_is_keepalive (SoupMessage *msg)
return FALSE;
if (SOUP_MESSAGE_GET_PRIVATE (msg)->http_version == SOUP_HTTP_1_0) {
- /* Only persistent if the client requested keepalive
- * and the server agreed.
+ /* In theory, HTTP/1.0 connections are only persistent
+ * if the client requests it, and the server agrees.
+ * But some servers do keep-alive even if the client
+ * doesn't request it. So ignore c_conn.
*/
- if (!c_conn || !s_conn)
- return FALSE;
- if (!soup_header_contains (c_conn, "Keep-Alive") ||
- !soup_header_contains (s_conn, "Keep-Alive"))
+ if (!s_conn || !soup_header_contains (s_conn, "Keep-Alive"))
return FALSE;
} else {
/* Normally persistent unless either side requested otherwise */