--------------------- PatchSet 6068 Date: 2003/12/02 14:18:51 Author: rhorstmann Branch: icap-2_5 Tag: (none) Log: use urlCanonical and remove icapUrlCanonical again Members: src/icap_reqmod.c:1.1.2.26->1.1.2.27 Index: squid/src/icap_reqmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_reqmod.c,v retrieving revision 1.1.2.26 retrieving revision 1.1.2.27 diff -u -r1.1.2.26 -r1.1.2.27 --- squid/src/icap_reqmod.c 1 Dec 2003 14:23:45 -0000 1.1.2.26 +++ squid/src/icap_reqmod.c 2 Dec 2003 14:18:51 -0000 1.1.2.27 @@ -1,6 +1,6 @@ /* - * $Id: icap_reqmod.c,v 1.1.2.26 2003/12/01 14:23:45 rhorstmann Exp $ + * $Id: icap_reqmod.c,v 1.1.2.27 2003/12/02 14:18:51 rhorstmann Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -74,51 +74,6 @@ } /* - * copied from url.c - * - * the original function strips the qery terms (everything - * after a question-mark. this code is removed here. - */ -static char * -icapUrlCanonicalClean(const request_t * request) -{ - LOCAL_ARRAY(char, buf, MAX_URL); - LOCAL_ARRAY(char, portbuf, 32); - LOCAL_ARRAY(char, loginbuf, MAX_LOGIN_SZ + 1); - char *t; - if (request->protocol == PROTO_URN) { - snprintf(buf, MAX_URL, "urn:%s", strBuf(request->urlpath)); - } else { - switch (request->method) { - case METHOD_CONNECT: - snprintf(buf, MAX_URL, "%s:%d", request->host, request->port); - break; - default: - portbuf[0] = '\0'; - if (request->port != urlDefaultPort(request->protocol)) - snprintf(portbuf, 32, ":%d", request->port); - loginbuf[0] = '\0'; - if ((int) strlen(request->login) > 0) { - strcpy(loginbuf, request->login); - if ((t = strchr(loginbuf, ':'))) - *t = '\0'; - strcat(loginbuf, "@"); - } - snprintf(buf, MAX_URL, "%s://%s%s%s%s", - ProtocolStr[request->protocol], - loginbuf, - request->host, - portbuf, - strBuf(request->urlpath)); - } - } - if (stringHasCntl(buf)) - xstrncpy(buf, rfc1738_escape_unescaped(buf), MAX_URL); - return buf; -} - - -/* * icapReqModCreateClientState * * Creates fake client_side data structures so we can use @@ -141,7 +96,7 @@ * is used when doing a request to a parent proxy, we need the full * url here. */ - http->uri = xstrdup(icapUrlCanonicalClean(icap->request)); + http->uri = xstrdup(urlCanonical(icap->request)); http->log_uri = xstrndup(http->uri, MAX_URL); http->range_iter.boundary = StringNull; http->request = requestLink(request ? request : icap->request);