/*
- * $Id: cache_cf.cc,v 1.351 2000/06/25 22:28:42 wessels Exp $
+ * $Id: cache_cf.cc,v 1.352 2000/06/25 22:41:21 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
xstrerror());
Config2.effectiveGroupID = grp->gr_gid;
}
+ urlExtMethodConfigure();
}
/* Parse a time specification from the config file. Store the
#
-# $Id: cf.data.pre,v 1.188 2000/06/08 18:05:35 hno Exp $
+# $Id: cf.data.pre,v 1.189 2000/06/25 22:41:21 wessels Exp $
#
#
# SQUID Internet Object Cache http://squid.nlanr.net/Squid/
disable persistent connections with clients and/or servers.
DOC_END
+NAME: extension_methods
+TYPE: wordlist
+LOC: Config.ext_methods
+DEFAULT: none
+DOC_START
+ Squid only knows about standardized HTTP request methods.
+ You can add up to 20 additional "extension" methods here.
+DOC_END
+
EOF
/*
- * $Id: enums.h,v 1.167 2000/05/03 17:15:41 adrian Exp $
+ * $Id: enums.h,v 1.168 2000/06/25 22:41:22 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
METHOD_MOVE,
METHOD_LOCK,
METHOD_UNLOCK,
+ METHOD_EXT00,
+ METHOD_EXT01,
+ METHOD_EXT02,
+ METHOD_EXT03,
+ METHOD_EXT04,
+ METHOD_EXT05,
+ METHOD_EXT06,
+ METHOD_EXT07,
+ METHOD_EXT08,
+ METHOD_EXT09,
+ METHOD_EXT10,
+ METHOD_EXT11,
+ METHOD_EXT12,
+ METHOD_EXT13,
+ METHOD_EXT14,
+ METHOD_EXT15,
+ METHOD_EXT16,
+ METHOD_EXT17,
+ METHOD_EXT18,
+ METHOD_EXT19,
METHOD_ENUM_END
};
typedef unsigned int method_t;
/*
- * $Id: protos.h,v 1.372 2000/06/25 22:28:43 wessels Exp $
+ * $Id: protos.h,v 1.373 2000/06/25 22:41:22 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern int urlDefaultPort(protocol_t p);
extern char *urlCanonicalClean(const request_t *);
extern char *urlHostname(const char *url);
+extern void urlExtMethodConfigure();
extern void useragentOpenLog(void);
extern void useragentRotateLog(void);
/*
- * $Id: structs.h,v 1.340 2000/06/25 22:28:43 wessels Exp $
+ * $Id: structs.h,v 1.341 2000/06/25 22:41:22 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
int rebuild_chunk_percentage;
} digest;
#endif
+ wordlist *ext_methods;
};
struct _SquidConfig2 {
/*
- * $Id: url.cc,v 1.125 2000/05/16 07:06:08 wessels Exp $
+ * $Id: url.cc,v 1.126 2000/06/25 22:41:22 wessels Exp $
*
* DEBUG: section 23 URL Parsing
* AUTHOR: Duane Wessels
"MOVE",
"LOCK",
"UNLOCK",
+ "%EXT00",
+ "%EXT01",
+ "%EXT02",
+ "%EXT03",
+ "%EXT04",
+ "%EXT05",
+ "%EXT06",
+ "%EXT07",
+ "%EXT08",
+ "%EXT09",
+ "%EXT10",
+ "%EXT11",
+ "%EXT12",
+ "%EXT13",
+ "%EXT14",
+ "%EXT15",
+ "%EXT16",
+ "%EXT17",
+ "%EXT18",
+ "%EXT19",
"ERROR"
};
urlParseMethod(const char *s)
{
method_t method = METHOD_NONE;
+ /*
+ * This check for '%' makes sure that we don't
+ * match one of the extension method placeholders,
+ * which have the form %EXT[0-9][0-9]
+ */
+ if (*s == '%')
+ return METHOD_NONE;
for (method++; method < METHOD_ENUM_END; method++) {
if (0 == strcasecmp(s, RequestMethodStr[method]))
return method;
}
return host;
}
+
+static void
+urlExtMethodAdd(const char *mstr)
+{
+ method_t method = 0;
+ for (method++; method < METHOD_ENUM_END; method++) {
+ if (0 == strcmp(mstr, RequestMethodStr[method])) {
+ debug(23, 2) ("Extension method '%s' already exists\n", mstr);
+ return;
+ }
+ if (0 != strncmp("%EXT", RequestMethodStr[method], 4))
+ continue;
+ /* Don't free statically allocated "%EXTnn" string */
+ RequestMethodStr[method] = xstrdup(mstr);
+ debug(23, 1) ("Extension method '%s' added, enum=%d\n", mstr, (int) method);
+ return;
+ }
+ debug(23, 1) ("WARNING: Could not add new extension method '%s' due to lack of array space\n", mstr);
+}
+
+void
+urlExtMethodConfigure(void)
+{
+ wordlist *w = Config.ext_methods;
+ while (w) {
+ char *s;
+ for (s = w->key; *s; s++)
+ *s = xtoupper(*s);
+ urlExtMethodAdd(w->key);
+ w = w->next;
+ }
+}