]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove origin_tries limiter on forwarding
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 19 May 2013 03:45:03 +0000 (21:45 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 19 May 2013 03:45:03 +0000 (21:45 -0600)
This limit seems to have been set to prevent large amount of looping when
DIRECT attempts fail under the old model of constant DNS lookups and
retries.

However it is hard-coded and has no configuration knob visible. Under
the curent model of all destinations being enumerated once and tried
sequentially this protection would seem to be no longer necessary and
somewhat harmful as it will be preventing retries reaching destinations
with more than 2 unreachable IPs (think 3 IPv6 and an IPv4 on IPv4-only
network).

src/forward.cc
src/forward.h

index 9b25cb2e6c4fcb6a3a25e57b54af667693816dd0..b261886b5809754f9369b6fbfa4587a3eb1349c0 100644 (file)
@@ -518,9 +518,6 @@ FwdState::checkRetry()
     if (n_tries > Config.forward_max_tries)
         return false;
 
-    if (origin_tries > 2)
-        return false;
-
     if (squid_curtime - start_t > Config.Timeout.forward)
         return false;
 
@@ -940,9 +937,6 @@ FwdState::connectStart()
         debugs(17, 3, HERE << "reusing pconn " << serverConnection());
         ++n_tries;
 
-        if (!serverConnection()->getPeer())
-            ++origin_tries;
-
         comm_add_close_handler(serverConnection()->fd, fwdServerClosedWrapper, this);
 
         /* Update server side TOS and Netfilter mark on the connection. */
@@ -1131,9 +1125,6 @@ FwdState::reforward()
     if (n_tries > Config.forward_max_tries)
         return 0;
 
-    if (origin_tries > 1)
-        return 0;
-
     if (request->bodyNibbled())
         return 0;
 
index f2d0fbf2fc8f557577aa90e2bc46636a079a81c6..c8b8d9129a1997ef60c4a5e71ac8058ece779b03 100644 (file)
@@ -97,7 +97,6 @@ private:
     Comm::ConnectionPointer clientConn;        ///< a possibly open connection to the client.
     time_t start_t;
     int n_tries;
-    int origin_tries;
 
     // AsyncCalls which we set and may need cancelling.
     struct {