]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1122: persistent connection mixup on failed PUT/POST request
authorserassio <>
Mon, 4 Apr 2005 00:53:24 +0000 (00:53 +0000)
committerserassio <>
Mon, 4 Apr 2005 00:53:24 +0000 (00:53 +0000)
Forward port of 2.5 patch

src/http.cc
src/structs.h

index 5ab92074faf751d417153be893a1f3f58793f044..5577cc692f8f50e49253a1539a401be063befeb6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.448 2005/03/08 21:38:40 serassio Exp $
+ * $Id: http.cc,v 1.449 2005/04/03 18:53:24 serassio Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -857,6 +857,17 @@ HttpStateData::statusIfComplete() const
     if (!flags.keepalive)
         return COMPLETE_NONPERSISTENT_MSG;
 
+    /*
+     * If we haven't sent the whole request then this can not be a persistent
+     * connection.
+     */
+    if (!flags.request_sent) {
+        debug(11, 1) ("httpReadReply: Request not yet fully sent \"%s %s\"\n",
+                      RequestMethodStr[orig_request->method],
+                      storeUrl(entry));
+        return COMPLETE_NONPERSISTENT_MSG;
+    }
+
     /*
      * What does the reply have to say about keep-alive?
      */
@@ -1232,6 +1243,8 @@ HttpStateData::SendComplete(int fd, char *bufnotused, size_t size, comm_err_t er
          */
         commSetTimeout(fd, Config.Timeout.read, httpTimeout, httpState);
     }
+
+    httpState->flags.request_sent = 1;
 }
 
 /*
index 3a32c1452f6cb952d34ee980712fa813de6f927a..86b21132e15aec9b83fdd0c30ff6b1f85098690e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.514 2005/03/18 17:12:34 hno Exp $
+ * $Id: structs.h,v 1.515 2005/04/03 18:53:24 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -976,6 +976,9 @@ unsigned int keepalive_broken:
 
 unsigned int abuse_detected:
     1;
+
+unsigned int request_sent:
+    1;
 };
 
 struct _ipcache_addrs