]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3658: ERR_ZERO_SIZE errors propagates out even after successful retry
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 4 Oct 2012 11:53:31 +0000 (05:53 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 4 Oct 2012 11:53:31 +0000 (05:53 -0600)
src/HttpRequest.cc
src/HttpRequest.h
src/forward.cc

index 72be7f9da45f837d56f0a007bb61f5b102237c7d..8348f2ef19dba8d1f68754a19b8fe2f932c2b105 100644 (file)
@@ -207,6 +207,7 @@ HttpRequest::clone() const
     copy->hier = hier; // Is it safe to copy? Should we?
 
     copy->errType = errType;
+    copy->errDetail = errDetail;
 
     // XXX: what to do with copy->peer_login?
 
@@ -528,6 +529,14 @@ HttpRequest::detailError(err_type aType, int aDetail)
         errDetail = aDetail;
 }
 
+void
+HttpRequest::clearError()
+{
+    debugs(11, 7, HERE << "old error details: " << errType << '/' << errDetail);
+    errType = ERR_NONE;
+    errDetail = ERR_DETAIL_NONE;
+}
+
 const char *HttpRequest::packableURI(bool full_uri) const
 {
     if (full_uri)
index dc44fea7121dd3ac910b9fe286120044580211f1..737a7bc39aab7b8386f4b56faf4c05db96fca3b9 100644 (file)
@@ -121,6 +121,8 @@ public:
 
     /// sets error detail if no earlier detail was available
     void detailError(err_type aType, int aDetail);
+    /// clear error details, useful for retries/repeats
+    void clearError();
 
 protected:
     void clean();
index 3504cacff329af969e576ba42777f8493a589094..8f15fd335a032058baef93e4bccfe814fcd4acbe 100644 (file)
@@ -345,6 +345,7 @@ FwdState::startConnectionOrFail()
         // this server link regardless of what happens when connecting to it.
         // IF sucessfuly connected this top destination will become the serverConnection().
         request->hier.note(serverDestinations[0], request->GetHost());
+        request->clearError();
 
         connectStart();
     } else {