AuthReg.h \
YesNoNone.h \
YesNoNone.cc \
+ RefreshPattern.h \
cache_cf.cc \
CacheDigest.h \
CacheDigest.cc \
AuthReg.h \
YesNoNone.h \
YesNoNone.cc \
+ RefreshPattern.h \
cache_cf.cc \
CacheDigest.h \
CacheDigest.cc \
AuthReg.h \
YesNoNone.h \
YesNoNone.cc \
+ RefreshPattern.h \
cache_cf.cc \
cache_manager.cc \
carp.h \
AuthReg.h \
YesNoNone.h \
YesNoNone.cc \
+ RefreshPattern.h \
cache_cf.cc \
carp.h \
carp.cc \
AuthReg.h \
YesNoNone.h \
YesNoNone.cc \
+ RefreshPattern.h \
cache_cf.cc \
cache_manager.cc \
CacheDigest.h \
AuthReg.h \
YesNoNone.h \
YesNoNone.cc \
+ RefreshPattern.h \
cache_cf.cc \
debug.cc \
CacheDigest.h \
AuthReg.h \
YesNoNone.h \
YesNoNone.cc \
+ RefreshPattern.h \
cache_cf.cc \
cache_manager.cc \
CacheDigest.h \
--- /dev/null
+#ifndef SQUID_REFRESHPATTERN_H_
+#define SQUID_REFRESHPATTERN_H_
+/*
+ * SQUID Web Proxy Cache http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ * Squid is the result of efforts by numerous individuals from
+ * the Internet community; see the CONTRIBUTORS file for full
+ * details. Many organizations have provided support for Squid's
+ * development; see the SPONSORS file for full details. Squid is
+ * Copyrighted (C) 2001 by the Regents of the University of
+ * California; see the COPYRIGHT file for full details. Squid
+ * incorporates software developed and/or copyrighted by other
+ * sources; see the CREDITS file for full details.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+class RefreshPattern {
+public:
+ const char *pattern;
+ regex_t compiled_pattern;
+ time_t min;
+ double pct;
+ time_t max;
+ RefreshPattern *next;
+
+ struct {
+ unsigned int icase:1;
+ unsigned int refresh_ims:1;
+ unsigned int store_stale:1;
+#if USE_HTTP_VIOLATIONS
+ unsigned int override_expire:1;
+ unsigned int override_lastmod:1;
+ unsigned int reload_into_ims:1;
+ unsigned int ignore_reload:1;
+ unsigned int ignore_no_cache:1;
+ unsigned int ignore_no_store:1;
+ unsigned int ignore_must_revalidate:1;
+ unsigned int ignore_private:1;
+ unsigned int ignore_auth:1;
+#endif
+ } flags;
+ int max_stale;
+};
+
+#endif /* SQUID_REFRESHPATTERN_H_ */
class AclDenyInfoList;
class acl_size_t;
class HeaderManglers;
-class refresh_t;
+class RefreshPattern;
class SwapDir;
class RemovalPolicySettings;
int sanitycheck;
int telnet;
} Ftp;
- refresh_t *Refresh;
+ RefreshPattern *Refresh;
struct _cacheSwap {
RefCount<SwapDir> *swapDirs;
#include "mgr/Registration.h"
#include "Parsing.h"
#include "PeerDigest.h"
+#include "RefreshPattern.h"
#include "rfc1738.h"
#include "SquidConfig.h"
#include "SquidString.h"
static void update_maxobjsize(void);
static void configDoConfigure(void);
-static void parse_refreshpattern(refresh_t **);
+static void parse_refreshpattern(RefreshPattern **);
static uint64_t parseTimeUnits(const char *unit, bool allowMsec);
static void parseTimeLine(time_msec_t * tptr, const char *units, bool allowMsec);
static void parse_u_short(unsigned short * var);
#if USE_HTTP_VIOLATIONS
{
- const refresh_t *R;
+ const RefreshPattern *R;
for (R = Config.Refresh; R; R = R->next) {
if (!R->flags.override_expire)
#define free_tristate free_int
static void
-dump_refreshpattern(StoreEntry * entry, const char *name, refresh_t * head)
+dump_refreshpattern(StoreEntry * entry, const char *name, RefreshPattern * head)
{
while (head != NULL) {
storeAppendPrintf(entry, "%s%s %s %d %d%% %d",
}
static void
-parse_refreshpattern(refresh_t ** head)
+parse_refreshpattern(RefreshPattern ** head)
{
char *token;
char *pattern;
#endif
int i;
- refresh_t *t;
+ RefreshPattern *t;
regex_t comp;
int errcode;
int flags = REG_EXTENDED | REG_NOSUB;
pct = pct < 0.0 ? 0.0 : pct;
max = max < 0 ? 0 : max;
- t = static_cast<refresh_t *>(xcalloc(1, sizeof(refresh_t)));
+ t = static_cast<RefreshPattern *>(xcalloc(1, sizeof(RefreshPattern)));
t->pattern = (char *) xstrdup(pattern);
t->compiled_pattern = comp;
t->min = min;
}
static void
-free_refreshpattern(refresh_t ** head)
+free_refreshpattern(RefreshPattern ** head)
{
- refresh_t *t;
+ RefreshPattern *t;
while ((t = *head) != NULL) {
*head = t->next;
#include "peer_proxy_negotiate_auth.h"
#include "profiler/Profiler.h"
#include "refresh.h"
+#include "RefreshPattern.h"
#include "rfc1738.h"
#include "SquidConfig.h"
#include "SquidTime.h"
const char *v;
#if USE_HTTP_VIOLATIONS
- const refresh_t *R = NULL;
+ const RefreshPattern *R = NULL;
/* This strange looking define first looks up the refresh pattern
* and then checks if the specified flag is set. The main purpose
#include "HttpRequest.h"
#include "HttpReply.h"
#include "MemObject.h"
+#include "RefreshPattern.h"
#include "SquidTime.h"
#include "SquidConfig.h"
#include "Store.h"
#define REFRESH_DEFAULT_PCT 0.20
#define REFRESH_DEFAULT_MAX (time_t)259200
-static const refresh_t *refreshUncompiledPattern(const char *);
+static const RefreshPattern *refreshUncompiledPattern(const char *);
static OBJH refreshStats;
-static int refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age, const refresh_t * R, stale_flags * sf);
+static int refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age, const RefreshPattern * R, stale_flags * sf);
-static refresh_t DefaultRefresh;
+static RefreshPattern DefaultRefresh;
-const refresh_t *
+const RefreshPattern *
refreshLimits(const char *url)
{
- const refresh_t *R;
+ const RefreshPattern *R;
for (R = Config.Refresh; R; R = R->next) {
if (!regexec(&(R->compiled_pattern), url, 0, 0, 0))
return NULL;
}
-static const refresh_t *
+static const RefreshPattern *
refreshUncompiledPattern(const char *pat)
{
- const refresh_t *R;
+ const RefreshPattern *R;
for (R = Config.Refresh; R; R = R->next) {
if (0 == strcmp(R->pattern, pat))
* times.
*/
static int
-refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age, const refresh_t * R, stale_flags * sf)
+refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age, const RefreshPattern * R, stale_flags * sf)
{
/** \par
* Check for an explicit expiration time (Expires: header).
static int
refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
{
- const refresh_t *R;
+ const RefreshPattern *R;
const char *uri = NULL;
time_t age = 0;
time_t check_time = squid_curtime + delta;
time_t
getMaxAge(const char *url)
{
- const refresh_t *R;
+ const RefreshPattern *R;
debugs(22, 3, "getMaxAge: '" << url << "'");
if ((R = refreshLimits(url)))
#ifndef SQUID_REFRESH_H_
#define SQUID_REFRESH_H_
+class RefreshPattern;
+
extern void refreshAddToList(const char *, int, time_t, int, time_t);
extern int refreshIsCachable(const StoreEntry *);
extern int refreshCheckHTTP(const StoreEntry *, HttpRequest *);
extern int refreshCheckDigest(const StoreEntry *, time_t delta);
extern time_t getMaxAge(const char *url);
extern void refreshInit(void);
-extern const refresh_t *refreshLimits(const char *url);
+extern const RefreshPattern *refreshLimits(const char *url);
#endif /* SQUID_REFRESH_H_ */
class Store;
class CustomLog;
class cachemgr_passwd;
-class refresh_t;
namespace AnyP
{
struct PortCfg;
cachemgr_passwd *next;
};
-class refresh_t {
-public:
- const char *pattern;
- regex_t compiled_pattern;
- time_t min;
- double pct;
- time_t max;
- refresh_t *next;
-
- struct {
- unsigned int icase:1;
- unsigned int refresh_ims:1;
- unsigned int store_stale:1;
-#if USE_HTTP_VIOLATIONS
- unsigned int override_expire:1;
- unsigned int override_lastmod:1;
- unsigned int reload_into_ims:1;
- unsigned int ignore_reload:1;
- unsigned int ignore_no_cache:1;
- unsigned int ignore_no_store:1;
- unsigned int ignore_must_revalidate:1;
- unsigned int ignore_private:1;
- unsigned int ignore_auth:1;
-#endif
- } flags;
- int max_stale;
-};
-
#if USE_SSL
struct _sslproxy_cert_sign {