From: Amos Jeffries Date: Thu, 2 Aug 2012 03:32:26 +0000 (-0600) Subject: Skip Failure Ratio calculations entirely when ICP is disabled. X-Git-Tag: SQUID_3_2_0_19~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14d802e7df985640764f449510281225290694da;p=thirdparty%2Fsquid.git Skip Failure Ratio calculations entirely when ICP is disabled. Also, mention ICP in the logged error message. unqualified 'HIT' confuses people (self included) more familiar with the HTTP type of HIT responses. --- diff --git a/src/client_side_request.cc b/src/client_side_request.cc index c7dc229cd0..adc14fc42d 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -219,13 +219,17 @@ checkFailureRatio(err_type etype, hier_code hcode) #define FAILURE_MODE_TIME 300 #endif + if (hcode == HIER_NONE) + return; + + // don't bother when ICP is disabled. + if (Config.Port.icp <= 0) + return; + static double magic_factor = 100.0; double n_good; double n_bad; - if (hcode == HIER_NONE) - return; - n_good = magic_factor / (1.0 + request_failure_ratio); n_bad = magic_factor - n_good; @@ -256,7 +260,7 @@ checkFailureRatio(err_type etype, hier_code hcode) debugs(33, DBG_CRITICAL, "WARNING: Failure Ratio at "<< std::setw(4)<< std::setprecision(3) << request_failure_ratio); - debugs(33, DBG_CRITICAL, "WARNING: Going into hit-only-mode for " << + debugs(33, DBG_CRITICAL, "WARNING: ICP going into HIT-only mode for " << FAILURE_MODE_TIME / 60 << " minutes..."); hit_only_mode_until = squid_curtime + FAILURE_MODE_TIME;