From: hno <> Date: Thu, 24 May 2007 03:10:06 +0000 (+0000) Subject: Kill the redundant url_convert_hex function. Equivalent to rfc1738_unescape X-Git-Tag: SQUID_3_0_PRE7~238 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c5d57e059c6ac384a29e91157ad1e2689285436;p=thirdparty%2Fsquid.git Kill the redundant url_convert_hex function. Equivalent to rfc1738_unescape --- diff --git a/src/gopher.cc b/src/gopher.cc index 6dd6e779f0..0caff50f9a 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,6 +1,6 @@ /* - * $Id: gopher.cc,v 1.207 2007/05/23 21:07:43 hno Exp $ + * $Id: gopher.cc,v 1.208 2007/05/23 21:10:06 hno Exp $ * * DEBUG: section 10 Gopher * AUTHOR: Harvest Derived @@ -248,7 +248,7 @@ gopher_request_parse(const HttpRequest * req, char *type_id, char *request) if (request) { xstrncpy(request, path + 1, MAX_URL); /* convert %xx to char */ - url_convert_hex(request, 0); + rfc1738_unescape(request); } } diff --git a/src/protos.h b/src/protos.h index 39e107b54e..a4daa15aeb 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.545 2007/05/23 21:07:43 hno Exp $ + * $Id: protos.h,v 1.546 2007/05/23 21:10:07 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -624,8 +624,6 @@ SQUIDCEXTERN void unlinkdClose(void); SQUIDCEXTERN void unlinkdUnlink(const char *); #endif -SQUIDCEXTERN char *url_convert_hex(char *org_url, int allocate); -SQUIDCEXTERN char *url_escape(const char *url); SQUIDCEXTERN protocol_t urlParseProtocol(const char *, const char *e = NULL); SQUIDCEXTERN void urlInitialize(void); SQUIDCEXTERN HttpRequest *urlParse(method_t, char *, HttpRequest *request = NULL); diff --git a/src/url.cc b/src/url.cc index 0dc79767f2..0aadf1650a 100644 --- a/src/url.cc +++ b/src/url.cc @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.160 2007/05/23 21:07:43 hno Exp $ + * $Id: url.cc,v 1.161 2007/05/23 21:10:07 hno Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -49,38 +49,6 @@ static const char valid_hostname_chars[] = "0123456789-." ; -/* convert %xx in url string to a character - * Allocate a new string and return a pointer to converted string */ - -char * -url_convert_hex(char *org_url, int allocate) -{ - static char code[] = "00"; - char *url = NULL; - char *s = NULL; - char *t = NULL; - url = allocate ? (char *) xstrdup(org_url) : org_url; - - if ((int) strlen(url) < 3 || !strchr(url, '%')) - return url; - - for (s = t = url; *s; s++) { - if (*s == '%' && *(s + 1) && *(s + 2)) { - code[0] = *(++s); - code[1] = *(++s); - *t++ = (char) strtol(code, NULL, 16); - } else { - *t++ = *s; - } - } - - do { - *t++ = *s; - } while (*s++); - - return url; -} - void urlInitialize(void) {