--------------------- PatchSet 10256 Date: 2007/12/16 13:17:44 Author: adri Branch: s27_adri Tag: (none) Log: strBuf() -> strBuf2() in the http start routine; comment on converting storeUrl() to return a String and therefore simplifying a lot of what goes on. Members: ADRIAN_TODO:1.1.2.8->1.1.2.9 src/http.c:1.63.2.3.4.10->1.63.2.3.4.11 Index: squid/ADRIAN_TODO =================================================================== RCS file: /cvsroot/squid-sf//squid/Attic/ADRIAN_TODO,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -r1.1.2.8 -r1.1.2.9 --- squid/ADRIAN_TODO 14 Dec 2007 06:30:49 -0000 1.1.2.8 +++ squid/ADRIAN_TODO 16 Dec 2007 13:17:44 -0000 1.1.2.9 @@ -56,3 +56,6 @@ * aclMatchHeader() takes a temporary copy of the header string to compare against so it can run regexec() over the NUL-terminated string. This is temporary and really should be readdressed at a later date. + +* convert storeUrl() and similar to return String or a String reference! + Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.63.2.3.4.10 retrieving revision 1.63.2.3.4.11 diff -u -r1.63.2.3.4.10 -r1.63.2.3.4.11 --- squid/src/http.c 15 Dec 2007 11:09:22 -0000 1.63.2.3.4.10 +++ squid/src/http.c 16 Dec 2007 13:17:45 -0000 1.63.2.3.4.11 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.63.2.3.4.10 2007/12/15 11:09:22 adri Exp $ + * $Id: http.c,v 1.63.2.3.4.11 2007/12/16 13:17:45 adri Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -1468,12 +1468,16 @@ httpState->peer = fwd->servers->peer; /* might be NULL */ if (httpState->peer) { const char *url; - if (httpState->peer->options.originserver) - url = strBuf(orig_req->urlpath); - else + int len; + + if (httpState->peer->options.originserver) { + url = strBuf2(orig_req->urlpath); + len = strLen2(orig_req->urlpath); + } else { url = storeUrl(httpState->entry); - proxy_req = requestCreate(orig_req->method, - orig_req->protocol, url, strlen(url)); + len = strlen(url); + } + proxy_req = requestCreate(orig_req->method, orig_req->protocol, url, len); xstrncpy(proxy_req->host, httpState->peer->host, SQUIDHOSTNAMELEN); proxy_req->port = httpState->peer->http_port; proxy_req->flags = orig_req->flags;