From: serassio <> Date: Mon, 4 Apr 2005 00:53:24 +0000 (+0000) Subject: Bug #1122: persistent connection mixup on failed PUT/POST request X-Git-Tag: SQUID_3_0_PRE4~815 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72b63f06961589826558bab7572e5b91b6987c99;p=thirdparty%2Fsquid.git Bug #1122: persistent connection mixup on failed PUT/POST request Forward port of 2.5 patch --- diff --git a/src/http.cc b/src/http.cc index 5ab92074fa..5577cc692f 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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; } /* diff --git a/src/structs.h b/src/structs.h index 3a32c1452f..86b21132e1 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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