From: wessels <> Date: Tue, 27 Aug 1996 05:26:11 +0000 (+0000) Subject: add backwards compatibility for quick_abort X-Git-Tag: SQUID_3_0_PRE1~5918 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fea2e6e0fbf466297113f7b4f0a04a2bee7f9d20;p=thirdparty%2Fsquid.git add backwards compatibility for quick_abort --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 9651d9a3ba..b356a27632 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.cc,v 1.72 1996/08/26 22:47:49 wessels Exp $ + * $Id: cache_cf.cc,v 1.73 1996/08/26 23:26:11 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -586,13 +586,23 @@ static void parseQuickAbort() { char *token; int i; - - GetInteger(i); - Config.quickAbort.min = i * 1024; - GetInteger(i); - Config.quickAbort.pct = i * 128 / 100; /* 128 is full scale */ - GetInteger(i); - Config.quickAbort.max = i * 1024; + token = strtok(NULL, w_space); + if (!strcasecmp(token, "on")) { + Config.quickAbort.min = 10 << 10; /* 10k */ + Config.quickAbort.pct = 64; /* 50% */ + Config.quickAbort.max = 100 << 10; /* 100k */ + } else if (!strcasecmp(token, "off")) { + Config.quickAbort.min = -1; + Config.quickAbort.pct = 0; + Config.quickAbort.max = 0; + } else { + GetInteger(i); + Config.quickAbort.min = i * 1024; + GetInteger(i); + Config.quickAbort.pct = i * 128 / 100; /* 128 is full scale */ + GetInteger(i); + Config.quickAbort.max = i * 1024; + } } static void parseNegativeLine() @@ -678,12 +688,12 @@ static void parseProxyAuthLine() token = strtok(NULL, w_space); if (token == NULL) - self_destruct(); + self_destruct(); safe_free(Config.proxyAuthFile); safe_free(Config.proxyAuthIgnoreDomain); Config.proxyAuthFile = xstrdup(token); if ((token = strtok(NULL, w_space))) - Config.proxyAuthIgnoreDomain = xstrdup(token); + Config.proxyAuthIgnoreDomain = xstrdup(token); } #endif /* USE_PROXY_AUTH */ @@ -1217,8 +1227,8 @@ int parseConfigFile(file_name) parseIntegerValue(&Config.redirectChildren); #if USE_PROXY_AUTH - else if (!strcmp(token, "proxy_authentication")) - parseProxyAuthLine(); + else if (!strcmp(token, "proxy_authentication")) + parseProxyAuthLine(); #endif /* USE_PROXY_AUTH */ else if (!strcmp(token, "source_ping"))