From: wessels <> Date: Tue, 27 Aug 1996 03:59:57 +0000 (+0000) Subject: - Added patch from srb@cuci.nl (Stephen R. van den Berg) for X-Git-Tag: SQUID_3_0_PRE1~5921 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2546fcb32509e587a2a301bd30f08411dbde4330;p=thirdparty%2Fsquid.git - Added patch from srb@cuci.nl (Stephen R. van den Berg) for - ttl_force_pattern - quick_abort min pct max --- diff --git a/CONTRIBUTORS b/CONTRIBUTORS index aa79ad1ddf..0e72c8abfe 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -29,6 +29,7 @@ and ideas to make this software available. Igor Vinokurov Russell Street Cord Beermann + Stephen R. van den Berg Development of this caching software is funded by the National Science diff --git a/ChangeLog b/ChangeLog index bc1ccb17e6..e1e787c29a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ Changes to squid-1.1.alpha12: - Added -i option which forces IP cache entry to be invalidated just after an object retrieval begins. - Includes all squid-1.0 changes up to squid-1.0.10. + - Added patch from srb@cuci.nl (Stephen R. van den Berg) for + - ttl_force_pattern + - quick_abort min pct max Changes to squid-1.1.alpha11: @@ -45,6 +48,22 @@ Changes to squid-1.1.alpha8: - Cleaned up pointers in protoUnregister(). - Includes all squid-1.0 changes up to squid-1.0.6. +Changes to squid-1.1.alpha7.BuGless: + + - cache_swap 0 is allowed (proxy only server, no swapping), mainly + intended for fast maintenance startups where the system already + has to be running, but the disk(s) have not been fsck'd yet. + - quick_abort actually works now + - quick_abort functionality made conditional + - ttl_pattern storage wasn't being cleaned upon a reread of + the config file (the patterns were added only, got duplicates) + - ttl_force_pattern a new config option to override the settings + of certain pages despite (or because) of enforced low expiry times + - Reduced the struct sentry size. Moved some attributes to mem_obj, + eliminated some. On typical 32-bit machines the size was 52 bytes, + now it's 32. + - Reduced /cache/log file size (still compatible with old format) + Changes to squid-1.1.alpha7: - Added 'tcp_recv_bufsize' option to config. diff --git a/include/version.h b/include/version.h index 394c81bed0..a488995c98 100644 --- a/include/version.h +++ b/include/version.h @@ -1,9 +1,9 @@ -/* $Id: version.h,v 1.31 1996/08/23 21:31:35 wessels Exp $ +/* $Id: version.h,v 1.32 1996/08/26 22:00:04 wessels Exp $ * * SQUID_VERSION - String for version id of this distribution */ #ifndef SQUID_VERSION -#define SQUID_VERSION "1.1.alpha12" +#define SQUID_VERSION "1.1.alpha7.BuGless" #endif #ifndef SQUID_RELEASE_TIME diff --git a/src/cache_cf.cc b/src/cache_cf.cc index e1a8dfb49f..6378d268fa 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.cc,v 1.70 1996/08/23 21:15:45 wessels Exp $ + * $Id: cache_cf.cc,v 1.71 1996/08/26 22:00:04 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -164,7 +164,9 @@ struct SquidConfig Config; #define DefaultSourcePing 0 /* default off */ #define DefaultCommonLogFormat 0 /* default off */ #define DefaultIdentLookup 0 /* default off */ -#define DefaultQuickAbort 0 /* default off */ +#define DefaultQuickAbortMin -1 /* default off */ +#define DefaultQuickAbortPct 0 /* default off */ +#define DefaultQuickAbortMax 0 /* default off */ #define DefaultNeighborTimeout 2 /* 2 seconds */ #define DefaultStallDelay 1 /* 1 seconds */ #define DefaultSingleParentBypass 0 /* default off */ @@ -540,18 +542,55 @@ static void parseTTLPattern() if (token != (char *) NULL) { /* pct_age is optional */ if (sscanf(token, "%d", &pct_age) != 1) self_destruct(); - } - token = strtok(NULL, w_space); /* token: age_max */ - if (token != (char *) NULL) { /* age_max is optional */ - if (sscanf(token, "%d", &i) != 1) - self_destruct(); - age_max = (time_t) (i * 60); /* convert minutes to seconds */ + + token = strtok(NULL, w_space); /* token: age_max */ + if (token != (char *) NULL) { /* age_max is optional */ + if (sscanf(token, "%d", &i) != 1) + self_destruct(); + age_max = (time_t) (i * 60); /* convert minutes to seconds */ + } } ttlAddToList(pattern, abs_ttl, pct_age, age_max); safe_free(pattern); } +static void parseTTLForcePattern() +{ + char *token; + char *pattern; + time_t abs_ttl = 0; + time_t age_max = Config.ageMaxDefault; + int i; + + token = strtok(NULL, w_space); /* token: regex pattern */ + if (token == NULL) + self_destruct(); + pattern = xstrdup(token); + + GetInteger(i); /* token: abs_ttl */ + abs_ttl = (time_t) (i * 60); /* convert minutes to seconds */ + + GetInteger(i); + age_max = (time_t) (i * 60); /* convert minutes to seconds */ + ttlAddToForceList(pattern, abs_ttl, age_max); + + safe_free(pattern); +} + +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; +} + static void parseNegativeLine() { char *token; @@ -1106,6 +1145,12 @@ int parseConfigFile(file_name) else if (!strcmp(token, "ttl_pattern")) parseTTLPattern(); + else if (!strcmp(token, "ttl_force_pattern")) + parseTTLForcePattern(); + + else if (!strcmp(token, "quick_abort")) + parseQuickAbort(); + else if (!strcmp(token, "negative_ttl")) parseNegativeLine(); @@ -1154,9 +1199,6 @@ int parseConfigFile(file_name) else if (!strcmp(token, "source_ping")) parseOnOff(&Config.sourcePing); - else if (!strcmp(token, "quick_abort")) - parseOnOff(&Config.quickAbort); - else if (!strcmp(token, "emulate_httpd_log")) parseOnOff(&Config.commonLogFormat); @@ -1263,8 +1305,6 @@ int parseConfigFile(file_name) printf("WARNING: cache_swap (%d kbytes) is less than cache_mem (%d bytes).\n", Config.Swap.maxSize, Config.Mem.maxSize); printf(" This will cause serious problems with your cache!!!\n"); printf(" Change your configuration file.\n"); - Config.Swap.maxSize = Config.Mem.maxSize >> 10; - printf(" For this run, however, %s will use %d kbytes for cache_swap.\n", appname, Config.Swap.maxSize); fflush(stdout); /* print message */ } if (Config.cleanRate > -1 && Config.cleanRate < 60) { @@ -1355,6 +1395,7 @@ static void configFreeMemory() wordlistDestroy(&Config.inside_firewall_list); wordlistDestroy(&Config.dns_testname_list); safe_free(Config.sslProxy.host); + ttlFreeList(); } @@ -1392,7 +1433,9 @@ static void configSetFactoryDefaults() Config.redirectChildren = DefaultRedirectChildren; Config.hotVmFactor = DefaultHotVmFactor; Config.sourcePing = DefaultSourcePing; - Config.quickAbort = DefaultQuickAbort; + Config.quickAbort.min = DefaultQuickAbortMin; + Config.quickAbort.pct = DefaultQuickAbortPct; + Config.quickAbort.max = DefaultQuickAbortMax; Config.commonLogFormat = DefaultCommonLogFormat; Config.debugOptions = safe_xstrdup(DefaultDebugOptions); Config.neighborTimeout = DefaultNeighborTimeout; diff --git a/src/squid.h b/src/squid.h index 1742c45f42..a50439f801 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.39 1996/08/26 19:57:11 wessels Exp $ + * $Id: squid.h,v 1.40 1996/08/26 22:00:07 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -288,6 +288,8 @@ extern void send_announce _PARAMS((void)); extern int sslStart _PARAMS((int fd, char *, request_t *, char *, int *sz)); extern char *storeToString _PARAMS((StoreEntry *)); extern void ttlSet _PARAMS((StoreEntry *)); +extern void ttlFreeList _PARAMS((void)); extern void ttlAddToList _PARAMS((char *, time_t, int, time_t)); +extern void ttlAddToForceList _PARAMS((char *, time_t, time_t)); extern int waisStart _PARAMS((int, char *, method_t, char *, StoreEntry *)); extern void storeDirClean _PARAMS((void));