]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: urlParseProtocol() is unused outside url.cc
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 31 Jul 2015 00:16:40 +0000 (17:16 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 31 Jul 2015 00:16:40 +0000 (17:16 -0700)
src/URL.h
src/url.cc

index f13df3de3e48ccf3a615ad274a981660ca620955..3c1b1933cb52cba00a754e4123c1834999ea321f 100644 (file)
--- a/src/URL.h
+++ b/src/URL.h
@@ -140,7 +140,6 @@ operator <<(std::ostream &os, const URL &url)
 class HttpRequest;
 class HttpRequestMethod;
 
-AnyP::ProtocolType urlParseProtocol(const char *, const char *e = NULL);
 void urlInitialize(void);
 HttpRequest *urlParse(const HttpRequestMethod&, char *, HttpRequest *request = NULL);
 char *urlCanonicalClean(const HttpRequest *);
index 0e8e58c9816f4d0045bce36addf4d7caa7f6542a..7a22ea58e639d86fc35fb49be409fcf74035f824 100644 (file)
@@ -112,22 +112,14 @@ urlInitialize(void)
 }
 
 /**
- * urlParseProtocol() takes begin (b) and end (e) pointers, but for
- * backwards compatibility, e defaults to NULL, in which case we
- * assume b is NULL-terminated.
+ * Parse the scheme name from string b, into protocol type.
+ * The string must be 0-terminated.
  */
 AnyP::ProtocolType
-urlParseProtocol(const char *b, const char *e)
+urlParseProtocol(const char *b)
 {
-    /*
-     * if e is NULL, b must be NULL terminated and we
-     * make e point to the first whitespace character
-     * after b.
-     */
-
-    if (NULL == e)
-        e = b + strcspn(b, ":");
-
+    // make e point to the ':' character
+    const char *e = b + strcspn(b, ":");
     int len = e - b;
 
     /* test common stuff first */