From 53095c541d677d0b6f96fc9becca1c1329c37975 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 20 Aug 2009 14:14:52 -0400 Subject: [PATCH] Fix the definition of soup_message_is_keepalive() for HTTP/1.0 Fixes a problem where some requests would reach 100% but never "finish" --- libsoup/soup-message.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c index 1f0c8ac..020577a 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 */ -- 2.7.4