]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugfix in client persistent connections: Don't assume that the fact that
authorhno <>
Sat, 24 Aug 2002 07:59:51 +0000 (07:59 +0000)
committerhno <>
Sat, 24 Aug 2002 07:59:51 +0000 (07:59 +0000)
the client sent a HTTP/1.1 request as an indication that we can use a
HTTP/1.0 style persistent connection. A HTTP/1.1 client does not need
to understand or expect HTTP/1.0 style persistent connections.

src/client_side.cc

index c391e23855f6c5a1d357fafa84e0336d6d816ddb..c35e695d151e9e8643ab294ef2112ab57a2f53e8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.586 2002/08/22 20:26:38 wessels Exp $
+ * $Id: client_side.cc,v 1.587 2002/08/24 01:59:51 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1026,14 +1026,19 @@ clientSetKeepaliveFlag(clientHttpRequest * http)
 {
     request_t *request = http->request;
     const HttpHeader *req_hdr = &request->header;
+
     debug(33, 3) ("clientSetKeepaliveFlag: http_ver = %d.%d\n",
        request->http_ver.major, request->http_ver.minor);
     debug(33, 3) ("clientSetKeepaliveFlag: method = %s\n",
        RequestMethodStr[request->method]);
     if (!Config.onoff.client_pconns)
        request->flags.proxy_keepalive = 0;
-    else if (httpMsgIsPersistent(request->http_ver, req_hdr))
-       request->flags.proxy_keepalive = 1;
+    else {
+       http_version_t http_ver;
+       httpBuildVersion(&http_ver, 1, 0);      /* we are HTTP/1.0, no matter what the client requests... */
+       if (httpMsgIsPersistent(http_ver, req_hdr))
+           request->flags.proxy_keepalive = 1;
+    }
 }
 
 static int