head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.10 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.8 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.6 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.4 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.2 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.1.1.1.0.6 pkgsrc-2008Q4-base:1.1.1.1 pkgsrc-2008Q3:1.1.1.1.0.4 pkgsrc-2008Q3-base:1.1.1.1 cube-native-xorg:1.1.1.1.0.2 cube-native-xorg-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.2 date 2009.02.05.14.09.03; author taca; state dead; branches; next 1.1; 1.1 date 2008.09.12.15.09.19; author taca; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.09.12.15.09.19; author taca; state Exp; branches; next ; desc @@ 1.2 log @Remove www/squid26. Squid 2.6's support was end. Please use www/squid27 instead. @ text @$NetBSD: patch-aj,v 1.1 2008/09/12 15:09:19 taca Exp $ --- src/access_log.c.orig 2008-03-18 11:58:47.000000000 +0900 +++ src/access_log.c @@@@ -90,6 +90,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) { @@@@ -99,13 +101,41 @@@@ log_quote(const char *header) } buf = xcalloc(1, (strlen(header) * 3) + 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++ = '\\'; @@@@ -113,6 +143,7 @@@@ log_quote(const char *header) } else if (c == '\n') { *buf_cursor++ = '\\'; *buf_cursor++ = 'n'; + check_name = 1; } else #endif if (c <= 0x1F @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ @ 1.1.1.1 log @Importing squid-2.6.21 (2.6.STABLE21) package as www/squid26. * This is legacy stable release but I keep it for a while. * Switch to new squid package frame work. * Drop RunCache support. Bump PKGREVISION. @ text @@