diff options
author | Timo Teräs <timo.teras@iki.fi> | 2011-10-07 22:32:59 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2011-10-07 22:34:00 +0300 |
commit | bcfb0aecc96607b65491091425ecb2bdaa8b1478 (patch) | |
tree | 8b692b5b8bc2f826abce4c2dd5f971f62a1971d2 | |
parent | 43434015880555c2df7d46048ba5ea20c934b7f4 (diff) | |
download | aports-bcfb0aecc96607b65491091425ecb2bdaa8b1478.tar.bz2 aports-bcfb0aecc96607b65491091425ecb2bdaa8b1478.tar.xz |
testing/squid: add loggable-urlgroup patch for squark support
-rw-r--r-- | testing/squid/APKBUILD | 4 | ||||
-rw-r--r-- | testing/squid/squid-3.2.0.12-loggable-urlgroup.patch | 111 |
2 files changed, 114 insertions, 1 deletions
diff --git a/testing/squid/APKBUILD b/testing/squid/APKBUILD index ce4d251ac8..d98a795626 100644 --- a/testing/squid/APKBUILD +++ b/testing/squid/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=squid pkgver=3.2.0.12 -pkgrel=0 +pkgrel=1 pkgdesc="A full-featured Web proxy cache server." url="http://www.squid-cache.org" install="squid.pre-install squid.pre-upgrade squid.post-install" @@ -19,6 +19,7 @@ linguas="af ar az bg ca cs da de el es et fa fi fr he hu hy id it ja ko lt langdir="/usr/share/squid/errors" source="http://www.squid-cache.org/Versions/v3/3.2/squid-$pkgver.tar.bz2 + squid-3.2.0.12-loggable-urlgroup.patch squid.initd squid.confd $pkgname.logrotate @@ -280,6 +281,7 @@ errors_ukrainian_utf8() { md5sums="f11b71b7c58a2a20e87707d4ba441743 squid-3.2.0.12.tar.bz2 +084f7b1af1ac0cb8fea35c7a0905a80e squid-3.2.0.12-loggable-urlgroup.patch 57fed05adc40acab6a5480ec7a014154 squid.initd 44b052db7910f386ef88ddcf69c9ba4e squid.confd 58823e0b86bc2dc71d270208b7b284b4 squid.logrotate" diff --git a/testing/squid/squid-3.2.0.12-loggable-urlgroup.patch b/testing/squid/squid-3.2.0.12-loggable-urlgroup.patch new file mode 100644 index 0000000000..ee1646fe58 --- /dev/null +++ b/testing/squid/squid-3.2.0.12-loggable-urlgroup.patch @@ -0,0 +1,111 @@ +Index: squid-3.2.0.12/src/client_side_request.cc +=================================================================== +--- squid-3.2.0.12.orig/src/client_side_request.cc 2011-10-07 20:29:10.000000000 +0300 ++++ squid-3.2.0.12/src/client_side_request.cc 2011-10-07 21:54:38.000000000 +0300 +@@ -1165,6 +1165,15 @@ + redirect_state = REDIRECT_DONE; + + if (result) { ++ if (result[0] == '!') { ++ char *t = strchr(result+1, '!'); ++ if (t != NULL) { ++ old_request->urlgroup.reset(NULL); ++ old_request->urlgroup.append(result + 1, t - result - 1); ++ result = t + 1; ++ } ++ } ++ + http_status status = (http_status) atoi(result); + + if (status == HTTP_MOVED_PERMANENTLY +@@ -1183,7 +1192,7 @@ + else + debugs(85, DBG_CRITICAL, "ERROR: URL-rewrite produces invalid 303 redirect Location: " << result); + } +- } else if (strcmp(result, http->uri)) { ++ } else if (result[0] != 0 && strcmp(result, http->uri)) { + // XXX: validate the URL properly *without* generating a whole new request object right here. + // XXX: the clone() should be done only AFTER we know the new URL is valid. + HttpRequest *new_request = old_request->clone(); +Index: squid-3.2.0.12/src/HttpRequest.cc +=================================================================== +--- squid-3.2.0.12.orig/src/HttpRequest.cc 2011-10-07 21:02:45.000000000 +0300 ++++ squid-3.2.0.12/src/HttpRequest.cc 2011-10-07 21:03:45.000000000 +0300 +@@ -106,6 +106,7 @@ + peer_login = NULL; // not allocated/deallocated by this class + peer_domain = NULL; // not allocated/deallocated by this class + vary_headers = NULL; ++ urlgroup = null_string; + myportname = null_string; + tag = null_string; + #if USE_AUTH +@@ -154,6 +155,7 @@ + range = NULL; + } + ++ urlgroup.clean(); + myportname.clean(); + + tag.clean(); +@@ -213,6 +215,7 @@ + copy->vary_headers = vary_headers ? xstrdup(vary_headers) : NULL; + // XXX: what to do with copy->peer_domain? + ++ copy->urlgroup = urlgroup; + copy->myportname = myportname; + copy->tag = tag; + #if USE_AUTH +Index: squid-3.2.0.12/src/HttpRequest.h +=================================================================== +--- squid-3.2.0.12.orig/src/HttpRequest.h 2011-10-07 21:02:45.000000000 +0300 ++++ squid-3.2.0.12/src/HttpRequest.h 2011-10-07 21:02:55.000000000 +0300 +@@ -187,6 +187,8 @@ + + char *peer_domain; /* Configured peer forceddomain */ + ++ String urlgroup; ++ + String myportname; // Internal tag name= value from port this requests arrived in. + + String tag; /* Internal tag for this request */ +Index: squid-3.2.0.12/src/format/Format.cc +=================================================================== +--- squid-3.2.0.12.orig/src/format/Format.cc 2011-10-07 21:33:38.000000000 +0300 ++++ squid-3.2.0.12/src/format/Format.cc 2011-10-07 21:41:45.000000000 +0300 +@@ -895,6 +895,12 @@ + out = tmp; + break; + ++ case LFT_REQUEST_URLGROUP: ++ if (al->request) ++ out = al->request->urlgroup.termedBuf(); ++ quote = 1; ++ break; ++ + case LFT_SERVER_REQ_METHOD: + if (al->adapted_request) { + out = al->adapted_request->method.image(); +Index: squid-3.2.0.12/src/format/Tokens.h +=================================================================== +--- squid-3.2.0.12.orig/src/format/Tokens.h 2011-10-07 21:34:25.000000000 +0300 ++++ squid-3.2.0.12/src/format/Tokens.h 2011-10-07 21:40:26.000000000 +0300 +@@ -100,6 +100,7 @@ + /*LFT_REQUEST_QUERY, */ + LFT_REQUEST_VERSION_OLD_2X, + LFT_REQUEST_VERSION, ++ LFT_REQUEST_URLGROUP, + + /* Request-Line details sent to the server/peer */ + LFT_SERVER_REQ_METHOD, +Index: squid-3.2.0.12/src/format/Tokens.cc +=================================================================== +--- squid-3.2.0.12.orig/src/format/Tokens.cc 2011-10-07 21:38:05.000000000 +0300 ++++ squid-3.2.0.12/src/format/Tokens.cc 2011-10-07 21:40:55.000000000 +0300 +@@ -114,6 +114,7 @@ + {"rp", LFT_REQUEST_URLPATH_OLD_31}, + /* { "rq", LFT_REQUEST_QUERY }, * / / * the query-string, INCLUDING the leading ? */ + {"rv", LFT_REQUEST_VERSION}, ++ {"rG", LFT_REQUEST_URLGROUP}, + + {"<rm", LFT_SERVER_REQ_METHOD}, + {"<ru", LFT_SERVER_REQ_URI}, |