summaryrefslogtreecommitdiff
path: root/www/squid/patches
diff options
context:
space:
mode:
authorjdolecek <jdolecek@pkgsrc.org>2000-11-02 10:31:38 +0000
committerjdolecek <jdolecek@pkgsrc.org>2000-11-02 10:31:38 +0000
commitdc177a8d19b70d52a9846ebe190f1014435ea2ec (patch)
treed66e73d2b6980eb952ecd668d5a65ce894e3196e /www/squid/patches
parent8053b25f397e3c71d87da3f182ef915cb2590c76 (diff)
downloadpkgsrc-dc177a8d19b70d52a9846ebe190f1014435ea2ec.tar.gz
add log_mime_hdrs_list directive - this directive specifies list of
headers to log into access log when log_mime_hdrs is on the change will be sent to Squid maintainers for possible future inclusion shortly
Diffstat (limited to 'www/squid/patches')
-rw-r--r--www/squid/patches/patch-aj64
-rw-r--r--www/squid/patches/patch-ak26
-rw-r--r--www/squid/patches/patch-al12
3 files changed, 102 insertions, 0 deletions
diff --git a/www/squid/patches/patch-aj b/www/squid/patches/patch-aj
new file mode 100644
index 00000000000..e791c1a589f
--- /dev/null
+++ b/www/squid/patches/patch-aj
@@ -0,0 +1,64 @@
+$NetBSD: patch-aj,v 1.3 2000/11/02 10:31:39 jdolecek Exp $
+
+--- access_log.c.orig Thu Nov 2 10:00:04 2000
++++ access_log.c Thu Nov 2 11:06:28 2000
+@@ -122,6 +122,8 @@ log_quote(const char *header)
+ {
+ int c;
+ int i;
++ int log_all, check_name, log_this;
++ const struct _wordlist *wl;
+ char *buf;
+ char *buf_cursor;
+ if (header == NULL) {
+@@ -131,13 +133,41 @@ log_quote(const char *header)
+ }
+ buf = xcalloc((strlen(header) * 3) + 1, 1);
+ buf_cursor = buf;
++
++ /* if empty or first keyword is "all", log all mime headers */
++ log_all = (!Config.log_mime_hdrs_list
++ || strcasecmp(Config.log_mime_hdrs_list->key, "all") == 0);
++
+ /*
+ * We escape: \x00-\x1F"#%;<>?{}|\\\\^~`\[\]\x7F-\xFF
+ * which is the default escape list for the CPAN Perl5 URI module
+ * modulo the inclusion of space (x40) to make the raw logs a bit
+ * more readable.
+ */
+- while ((c = *(const unsigned char *) header++) != '\0') {
++ check_name = 1;
++ log_this = 1;
++ for(; (c = *(const unsigned char *) header) != '\0'; header++) {
++ if (!log_all && check_name) {
++ /* loop over configured header names and only continue
++ * if the current header is on the list */
++ wl = Config.log_mime_hdrs_list;
++ log_this = 0;
++ for(; wl; wl = wl->next) {
++ if (strncasecmp(wl->key, header, strlen(wl->key)) == 0){
++ log_this = 1;
++ break;
++ }
++ }
++ check_name = 0;
++ }
++ if (!log_this) {
++ if (c == '\n') {
++ /* check header name in next iteration */
++ check_name = 1;
++ }
++ continue;
++ }
++
+ #if !OLD_LOG_MIME
+ if (c == '\r') {
+ *buf_cursor++ = '\\';
+@@ -145,6 +175,7 @@ log_quote(const char *header)
+ } else if (c == '\n') {
+ *buf_cursor++ = '\\';
+ *buf_cursor++ = 'n';
++ check_name = 1;
+ } else
+ #endif
+ if (c <= 0x1F
diff --git a/www/squid/patches/patch-ak b/www/squid/patches/patch-ak
new file mode 100644
index 00000000000..13398ef7c45
--- /dev/null
+++ b/www/squid/patches/patch-ak
@@ -0,0 +1,26 @@
+$NetBSD: patch-ak,v 1.3 2000/11/02 10:31:39 jdolecek Exp $
+
+--- cf.data.pre.orig Thu Nov 2 09:56:18 2000
++++ cf.data.pre Thu Nov 2 10:48:58 2000
+@@ -773,6 +773,21 @@ DOC_START
+ log_mime_hdrs off
+ DOC_END
+
++NAME: log_mime_hdrs_list
++TYPE: wordlist
++LOC: Config.log_mime_hdrs_list
++DEFAULT: none
++DOC_START
++ The Cache can record both the request and the response MIME
++ headers for each HTTP transaction. The headers are encoded
++ safely and will appear as two bracketed fields at the end of
++ the access log (for either the native or httpd-emulated log
++ formats). This list specifies which headers should be passed.
++ Note header logging need to be enabled by 'log_mime_hdrs on'
++ first.
++
++log_mime_hdrs_list all
++DOC_END
+
+ NAME: useragent_log
+ TYPE: string
diff --git a/www/squid/patches/patch-al b/www/squid/patches/patch-al
new file mode 100644
index 00000000000..3500970f2e2
--- /dev/null
+++ b/www/squid/patches/patch-al
@@ -0,0 +1,12 @@
+$NetBSD: patch-al,v 1.1 2000/11/02 10:31:39 jdolecek Exp $
+
+--- structs.h.orig Thu Nov 2 09:51:20 2000
++++ structs.h Thu Nov 2 09:52:03 2000
+@@ -359,6 +359,7 @@ struct _SquidConfig {
+ wordlist *mcast_group_list;
+ wordlist *dns_testname_list;
+ wordlist *dns_nameservers;
++ wordlist *log_mime_hdrs_list;
+ peer *peers;
+ int npeers;
+ struct {