]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1935 fix: Do not retry a request after sending [some of] its body.
authorrousskov <>
Mon, 16 Apr 2007 23:43:27 +0000 (23:43 +0000)
committerrousskov <>
Mon, 16 Apr 2007 23:43:27 +0000 (23:43 +0000)
Replaced forgotten request_flags::body_sent with HttpRequest::bodyNibbled()
that does not need to be manually updated. The BodyPipe changes probably
deleted the code that set request_flags::body_sent.

src/HttpRequest.cc
src/HttpRequest.h
src/forward.cc
src/structs.h

index a68e28c245ba9c7c7b2adac81a07d215ad587aca..94dbd814f23f64cee490d4e2693d4b929dd7858e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpRequest.cc,v 1.71 2007/04/06 04:50:04 rousskov Exp $
+ * $Id: HttpRequest.cc,v 1.72 2007/04/16 17:43:27 rousskov Exp $
  *
  * DEBUG: section 73    HTTP Request
  * AUTHOR: Duane Wessels
@@ -343,6 +343,10 @@ request_flags::cloneAdaptationImmune() const
     return *this;
 }
 
+bool
+HttpRequest::bodyNibbled() const {
+    return body_pipe != NULL && body_pipe->consumedSize() > 0;
+}
 
 const char *HttpRequest::packableURI(bool full_uri) const
 {
index cffb1f90edff2b05af38274cfe751c420021ed1e..7f6f338127ea119a4079c3fede9a6b1d7ff9c3c7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpRequest.h,v 1.25 2007/04/06 04:50:04 rousskov Exp $
+ * $Id: HttpRequest.h,v 1.26 2007/04/16 17:43:27 rousskov Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -137,6 +137,8 @@ public:
 
     virtual bool expectingBody(method_t unused, ssize_t&) const;
 
+    bool bodyNibbled() const; // the request has a [partially] consumed body
+
     int prefixLen();
 
     void swapOut(StoreEntry * e);
index 07c9f25ffffc214a170d693970522a13a1253590..efdbad76fa56eeea77ec799691d138a633d747c4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.156 2007/04/15 14:46:16 serassio Exp $
+ * $Id: forward.cc,v 1.157 2007/04/16 17:43:27 rousskov Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -441,7 +441,7 @@ FwdState::checkRetry()
     if (flags.dont_retry)
         return false;
 
-    if (request->flags.body_sent)
+    if (request->bodyNibbled())
         return false;
 
     return true;
@@ -1034,7 +1034,7 @@ FwdState::reforward()
     if (origin_tries > 1)
         return 0;
 
-    if (request->flags.body_sent)
+    if (request->bodyNibbled())
         return 0;
 
     assert(fs);
index 9ba0287f2b04ad76b9e330e902d287d7eaf82f86..42dd7e37a0d08c9de1a7b10d1f975269f747e55a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.554 2007/04/15 14:46:17 serassio Exp $
+ * $Id: structs.h,v 1.555 2007/04/16 17:43:27 rousskov Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -1236,7 +1236,7 @@ struct _iostats
 
 struct request_flags
 {
-    request_flags():range(0),nocache(0),ims(0),auth(0),cachable(0),hierarchical(0),loopdetect(0),proxy_keepalive(0),proxying(0),refresh(0),redirected(0),need_validation(0),accelerated(0),transparent(0),internal(0),internalclient(0),body_sent(0),must_keepalive(0),destinationIPLookedUp_(0)
+    request_flags():range(0),nocache(0),ims(0),auth(0),cachable(0),hierarchical(0),loopdetect(0),proxy_keepalive(0),proxying(0),refresh(0),redirected(0),need_validation(0),accelerated(0),transparent(0),internal(0),internalclient(0),must_keepalive(0),destinationIPLookedUp_(0)
     {
 #if HTTP_VIOLATIONS
         nocache_hack = 0;
@@ -1304,9 +1304,6 @@ unsigned int internal:
 unsigned int internalclient:
     1;
 
-unsigned int body_sent:
-    1;
-
 unsigned int must_keepalive:
     1;