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}, {"