From: Amos Jeffries Date: Thu, 2 Aug 2012 11:44:57 +0000 (-0600) Subject: Skip Failure Ratio calculations entirely when ICP is disabled. X-Git-Tag: SQUID_3_1_21~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56d02056f1ccc034e35309b5060721461a0323a8;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 77ca97df2a..dd331eaffa 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -209,13 +209,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; @@ -246,7 +250,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;