]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Kill the redundant url_convert_hex function. Equivalent to rfc1738_unescape
authorhno <>
Thu, 24 May 2007 03:10:06 +0000 (03:10 +0000)
committerhno <>
Thu, 24 May 2007 03:10:06 +0000 (03:10 +0000)
src/gopher.cc
src/protos.h
src/url.cc

index 6dd6e779f094be9132584acc28352d891acfe547..0caff50f9aa87d6e6f48246d48242c177ea2a6ec 100644 (file)
@@ -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);
     }
 }
 
index 39e107b54e453e22efa4b750956d214322b16f00..a4daa15aeb65e1c91908192533c81ead53cfbf5e 100644 (file)
@@ -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);
index 0dc79767f2c44a1eab318589f265208b6c79f13e..0aadf1650a887a40258257edaa19af5bc7f3f047 100644 (file)
@@ -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)
 {