]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4791: Build failure on MacOS (#220) M-staged-PR220
authorAmos Jeffries <yadij@users.noreply.github.com>
Tue, 12 Jun 2018 15:38:17 +0000 (15:38 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 13 Jun 2018 00:00:16 +0000 (00:00 +0000)
The src/URL.h and src/acl/Url.h files clash on MacOS case-
insensitive filesystem.

Resolve this and incorrect naming issue by moving class URL into
the AnyP namespace as AnyP::Uri.

42 files changed:
src/HttpRequest.cc
src/HttpRequest.h
src/Makefile.am
src/acl/Asn.cc
src/acl/DomainData.cc
src/acl/ServerName.cc
src/acl/Url.cc
src/adaptation/ServiceConfig.cc
src/adaptation/ecap/MessageRep.cc
src/adaptation/icap/ModXact.cc
src/anyp/Makefile.am
src/anyp/Uri.cc [moved from src/url.cc with 98% similarity]
src/anyp/Uri.h [moved from src/URL.h with 90% similarity]
src/anyp/forward.h
src/carp.cc
src/client_side.cc
src/client_side_reply.cc
src/client_side_request.cc
src/clients/Client.cc
src/clients/FtpGateway.cc
src/errorpage.cc
src/external_acl.cc
src/format/Format.cc
src/htcp.cc
src/http.cc
src/icmp/net_db.cc
src/icmp/net_db.h
src/internal.cc
src/main.cc
src/neighbors.cc
src/neighbors.h
src/peer_select.cc
src/refresh.cc
src/servers/FtpServer.cc
src/ssl/ServerBump.cc
src/ssl/support.cc
src/store_key_md5.cc
src/tests/Stub.list
src/tests/stub_libanyp.cc [moved from src/tests/stub_url.cc with 70% similarity]
src/tests/stub_libicmp.cc
src/tests/testURL.cc
src/urn.cc

index 5a2417385ea1822a31c624b24924034aeb241134..375cd186aa286cda13563147a2d35eccb367b1f5 100644 (file)
@@ -30,7 +30,6 @@
 #include "sbuf/StringConvert.h"
 #include "SquidConfig.h"
 #include "Store.h"
-#include "URL.h"
 
 #if USE_AUTH
 #include "auth/UserRequest.h"
index a963883885035ba2175f2e2b678a4263871b42a5..f8b7d4a8f774073aa949516707e9b701fe1ccd32 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef SQUID_HTTPREQUEST_H
 #define SQUID_HTTPREQUEST_H
 
+#include "anyp/Uri.h"
 #include "base/CbcPointer.h"
 #include "dns/forward.h"
 #include "err_type.h"
@@ -18,7 +19,6 @@
 #include "MasterXaction.h"
 #include "Notes.h"
 #include "RequestFlags.h"
-#include "URL.h"
 
 #if USE_AUTH
 #include "auth/UserRequest.h"
@@ -100,7 +100,7 @@ protected:
 
 public:
     HttpRequestMethod method;
-    URL url; ///< the request URI
+    AnyP::Uri url; ///< the request URI
 
 private:
 #if USE_ADAPTATION
index 050e7440f6b59ee8cd27d79bb9692cf5dafb0e52..b3007da9b05a5b9a6e1ae364df77bb2baed21311 100644 (file)
@@ -476,8 +476,6 @@ squid_SOURCES = \
        tunnel.cc \
        typedefs.h \
        $(UNLINKDSOURCE) \
-       url.cc \
-       URL.h \
        urn.h \
        urn.cc \
        wccp.h \
@@ -996,7 +994,7 @@ tests_testHttpReply_SOURCES=\
        tests/testHttpReply.cc \
        tests/testHttpReply.h \
        tests/stub_time.cc \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        wordlist.h \
        wordlist.cc
 nodist_tests_testHttpReply_SOURCES=\
@@ -1118,8 +1116,7 @@ tests_testACLMaxUserIP_SOURCES= \
        tests/testACLMaxUserIP.cc \
        tests/testACLMaxUserIP.h \
        tests/stub_time.cc \
-       tests/stub_url.cc \
-       URL.h \
+       tests/stub_libanyp.cc \
        MemBuf.cc \
        wordlist.h \
        wordlist.cc
@@ -1369,7 +1366,7 @@ tests_testCacheManager_SOURCES = \
        tests/stub_SwapDir.cc \
        MemStore.cc \
        $(UNLINKDSOURCE) \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        urn.h \
        urn.cc \
        wccp2.h \
@@ -1551,7 +1548,7 @@ tests_testDiskIO_SOURCES = \
        tests/testStoreSupport.h \
        tests/stub_time.cc \
        $(UNLINKDSOURCE) \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        $(WIN32_SOURCE) \
        wordlist.h \
        wordlist.cc \
@@ -1800,7 +1797,7 @@ tests_testEvent_SOURCES = \
        tests/stub_tunnel.cc \
        MemStore.cc \
        $(UNLINKDSOURCE) \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        urn.h \
        urn.cc \
        wccp2.h \
@@ -2034,7 +2031,7 @@ tests_testEventLoop_SOURCES = \
        tests/stub_tunnel.cc \
        MemStore.cc \
        $(UNLINKDSOURCE) \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        urn.h \
        urn.cc \
        wccp2.h \
@@ -2263,7 +2260,7 @@ tests_test_http_range_SOURCES = \
        tools.cc \
        tests/stub_tunnel.cc \
        $(UNLINKDSOURCE) \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        urn.h \
        urn.cc \
        wccp2.h \
@@ -2368,7 +2365,7 @@ tests_testHttp1Parser_SOURCES = \
        tests/testHttp1Parser.cc \
        tests/testHttp1Parser.h \
        tests/stub_time.cc \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        wordlist.h \
        wordlist.cc
 nodist_tests_testHttp1Parser_SOURCES = \
@@ -2565,7 +2562,6 @@ tests_testHttpRequest_SOURCES = \
        tests/stub_tunnel.cc \
        tests/stub_SwapDir.cc \
        MemStore.cc \
-       url.cc \
        urn.h \
        urn.cc \
        wccp2.h \
@@ -2801,7 +2797,7 @@ tests_testStore_SOURCES= \
        tests/TestSwapDir.cc \
        tests/TestSwapDir.h \
        tests/stub_time.cc \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        wordlist.h \
        wordlist.cc
 
@@ -2998,7 +2994,7 @@ tests_testUfs_SOURCES = \
        HttpHdrCc.cc \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        StatCounters.h \
        StatCounters.cc \
        StatHist.h \
@@ -3198,7 +3194,7 @@ tests_testRock_SOURCES = \
        tools.h \
        tests/stub_tools.cc \
        time.cc \
-       tests/stub_url.cc \
+       tests/stub_libanyp.cc \
        wordlist.h \
        wordlist.cc \
        $(DELAY_POOL_SOURCE) \
@@ -3424,7 +3420,6 @@ tests_testURL_SOURCES = \
        tools.h \
        tools.cc \
        tests/stub_tunnel.cc \
-       url.cc \
        urn.h \
        urn.cc \
        wccp2.h \
index 57be1ab9d8295ef872153927f4ec390c5cd38c32..a40941c2234b58d5448b6a13c9976cdcf445bbd3 100644 (file)
@@ -235,7 +235,7 @@ asnStats(StoreEntry * sentry)
 static void
 asnCacheStart(int as)
 {
-    // TODO: use class URL instead of generating a string and re-parsing
+    // TODO: use class AnyP::Uri instead of generating a string and re-parsing
     LOCAL_ARRAY(char, asres, 4096);
     StoreEntry *e;
     ASState *asState = new ASState;
index 2100992138b78032cb71ffa6aa6b10e9c0441858..13c15ba2fd67dedfe615bcbd7768db1c96a09b13 100644 (file)
 #include "squid.h"
 #include "acl/Checklist.h"
 #include "acl/DomainData.h"
+#include "anyp/Uri.h"
 #include "cache_cf.h"
 #include "ConfigParser.h"
 #include "Debug.h"
-#include "src/URL.h"
 #include "util.h"
 
 template<class T>
index a01241ff2ff6be7740efecbdfd9a248c1d2fac57..137c8968e622448e07074b0f6997850efcd94a4b 100644 (file)
@@ -22,7 +22,6 @@
 #include "ssl/bio.h"
 #include "ssl/ServerBump.h"
 #include "ssl/support.h"
-#include "URL.h"
 
 // Compare function for tree search algorithms
 static int
index 7bd65d653c3643bed0124820827d08ca9f9fc8d5..442f15f08c5874be225e1063896ec793a8006cac 100644 (file)
@@ -14,7 +14,6 @@
 #include "acl/Url.h"
 #include "HttpRequest.h"
 #include "rfc1738.h"
-#include "src/URL.h"
 
 int
 ACLUrlStrategy::match (ACLData<char const *> * &data, ACLFilledChecklist *checklist)
index 3c868f824057bba4fcf5c0d546e22d724e755d35..17cd55c14833cd0a15c60e5054af22af37530797 100644 (file)
@@ -189,7 +189,7 @@ bool
 Adaptation::ServiceConfig::grokUri(const char *value)
 {
     // TODO: find core code that parses URLs and extracts various parts
-    // AYJ: most of this is duplicate of URL::parse() in src/url.cc
+    // AYJ: most of this is duplicate of AnyP::Uri::parse()
 
     if (!value || !*value) {
         debugs(3, DBG_CRITICAL, HERE << cfg_filename << ':' << config_lineno << ": " <<
index 682f6ef6902f8f590588c143c30d7c38315b0bf1..9b18ccee9ee887ecd162db030c7beb73eeeed98d 100644 (file)
@@ -20,7 +20,6 @@
 #include "adaptation/ecap/MessageRep.h"
 #include "adaptation/ecap/XactionRep.h"
 #include "base/TextException.h"
-#include "URL.h"
 
 /* HeaderRep */
 
@@ -203,8 +202,8 @@ Adaptation::Ecap::RequestLineRep::RequestLineRep(HttpRequest &aMessage):
 void
 Adaptation::Ecap::RequestLineRep::uri(const Area &aUri)
 {
-    // TODO: if method is not set, URL::parse will assume it is not connect;
-    // Can we change URL::parse API to remove the method parameter?
+    // TODO: if method is not set, AnyP::Uri::parse will assume it is not connect;
+    // Can we change AnyP::Uri::parse API to remove the method parameter?
     const char *buf = aUri.toString().c_str();
     const bool ok = theMessage.url.parse(theMessage.method, buf);
     Must(ok);
index 8a15e1be8305ecf1201f56cd8902a6c8bb430987..332ea5aeba0fcd320d3bdeac18685e0205653158 100644 (file)
@@ -30,7 +30,6 @@
 #include "HttpReply.h"
 #include "MasterXaction.h"
 #include "SquidTime.h"
-#include "URL.h"
 
 // flow and terminology:
 //     HTTP| --> receive --> encode --> write --> |network
index 6bd41e5d584705f5faa8ab6cd7e2ae14f92ef5a9..a662ae2b9dd38c861af408e95bc544436bb4cab8 100644 (file)
@@ -18,6 +18,8 @@ libanyp_la_SOURCES = \
        ProtocolType.h \
        ProtocolVersion.h \
        TrafficMode.h \
+       Uri.cc \
+       Uri.h \
        UriScheme.cc \
        UriScheme.h
 
similarity index 98%
rename from src/url.cc
rename to src/anyp/Uri.cc
index 44b61522a2a6abc2769b2079c2abd12f87596424..30af7eedaf85b92fbe808e8a1038bef99798e168 100644 (file)
@@ -9,12 +9,12 @@
 /* DEBUG: section 23    URL Parsing */
 
 #include "squid.h"
+#include "anyp/Uri.h"
 #include "globals.h"
 #include "HttpRequest.h"
 #include "rfc1738.h"
 #include "SquidConfig.h"
 #include "SquidString.h"
-#include "URL.h"
 
 static const char valid_hostname_chars_u[] =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -30,21 +30,21 @@ static const char valid_hostname_chars[] =
     ;
 
 const SBuf &
-URL::Asterisk()
+AnyP::Uri::Asterisk()
 {
     static SBuf star("*");
     return star;
 }
 
 const SBuf &
-URL::SlashPath()
+AnyP::Uri::SlashPath()
 {
     static SBuf slash("/");
     return slash;
 }
 
 void
-URL::host(const char *src)
+AnyP::Uri::host(const char *src)
 {
     hostAddr_.setEmpty();
     hostAddr_ = src;
@@ -60,7 +60,7 @@ URL::host(const char *src)
 }
 
 const SBuf &
-URL::path() const
+AnyP::Uri::path() const
 {
     // RFC 3986 section 3.3 says path can be empty (path-abempty).
     // RFC 7230 sections 2.7.3, 5.3.1, 5.7.2 - says path cannot be empty, default to "/"
@@ -188,7 +188,7 @@ urlParseProtocol(const char *b)
  * being "end of host with implied path of /".
  */
 bool
-URL::parse(const HttpRequestMethod& method, const char *url)
+AnyP::Uri::parse(const HttpRequestMethod& method, const char *url)
 {
     LOCAL_ARRAY(char, proto, MAX_URL);
     LOCAL_ARRAY(char, login, MAX_URL);
@@ -224,7 +224,7 @@ URL::parse(const HttpRequestMethod& method, const char *url)
                 return false;
 
     } else if ((method == Http::METHOD_OPTIONS || method == Http::METHOD_TRACE) &&
-               URL::Asterisk().cmp(url) == 0) {
+               AnyP::Uri::Asterisk().cmp(url) == 0) {
         parseFinish(AnyP::PROTO_HTTP, nullptr, url, foundHost, SBuf(), 80 /* HTTP default port */);
         return true;
     } else if (strncmp(url, "urn:", 4) == 0) {
@@ -444,7 +444,7 @@ URL::parse(const HttpRequestMethod& method, const char *url)
 
 /// Update the URL object with parsed URI data.
 void
-URL::parseFinish(const AnyP::ProtocolType protocol,
+AnyP::Uri::parseFinish(const AnyP::ProtocolType protocol,
                  const char *const protoStr, // for unknown protocols
                  const char *const aUrlPath,
                  const char *const aHost,
@@ -459,7 +459,7 @@ URL::parseFinish(const AnyP::ProtocolType protocol,
 }
 
 void
-URL::touch()
+AnyP::Uri::touch()
 {
     absolute_.clear();
     authorityHttp_.clear();
@@ -467,7 +467,7 @@ URL::touch()
 }
 
 SBuf &
-URL::authority(bool requirePort) const
+AnyP::Uri::authority(bool requirePort) const
 {
     if (authorityHttp_.isEmpty()) {
 
@@ -485,7 +485,7 @@ URL::authority(bool requirePort) const
 }
 
 SBuf &
-URL::absolute() const
+AnyP::Uri::absolute() const
 {
     if (absolute_.isEmpty()) {
         // TODO: most URL will be much shorter, avoid allocating this much
@@ -774,7 +774,7 @@ urlCheckRequest(const HttpRequest * r)
     // we support OPTIONS and TRACE directed at us (with a 501 reply, for now)
     // we also support forwarding OPTIONS and TRACE, except for the *-URI ones
     if (r->method == Http::METHOD_OPTIONS || r->method == Http::METHOD_TRACE)
-        return (r->header.getInt64(Http::HdrType::MAX_FORWARDS) == 0 || r->url.path() != URL::Asterisk());
+        return (r->header.getInt64(Http::HdrType::MAX_FORWARDS) == 0 || r->url.path() != AnyP::Uri::Asterisk());
 
     if (r->method == Http::METHOD_PURGE)
         return 1;
@@ -928,7 +928,7 @@ URLHostName::extract(char const *aUrl)
     return Host;
 }
 
-URL::URL(AnyP::UriScheme const &aScheme) :
+AnyP::Uri::Uri(AnyP::UriScheme const &aScheme) :
     scheme_(aScheme),
     hostIsNumeric_(false),
     port_(0)
similarity index 90%
rename from src/URL.h
rename to src/anyp/Uri.h
index 97882df03f118f83d84a37c8061a29e37b591a06..5806438e2bb84c21c45859689e3d4884205a5ac7 100644 (file)
--- a/src/URL.h
@@ -6,8 +6,8 @@
  * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
-#ifndef SQUID_SRC_URL_H
-#define SQUID_SRC_URL_H
+#ifndef SQUID_SRC_ANYP_URI_H
+#define SQUID_SRC_ANYP_URI_H
 
 #include "anyp/UriScheme.h"
 #include "ip/Address.h"
 
 #include <iosfwd>
 
+class HttpRequestMethod;
+
+namespace AnyP
+{
+
 /**
- * The URL class represents a Uniform Resource Location
+ * Represents a Uniform Resource Identifier.
+ * Can store both URL or URN representations.
  *
  * Governed by RFC 3986
  */
-class URL
+class Uri
 {
-    MEMPROXY_CLASS(URL);
+    MEMPROXY_CLASS(Uri);
 
 public:
-    URL() : hostIsNumeric_(false), port_(0) {*host_=0;}
-    URL(AnyP::UriScheme const &aScheme);
-    URL(const URL &other) {
+    Uri() : hostIsNumeric_(false), port_(0) {*host_=0;}
+    Uri(AnyP::UriScheme const &aScheme);
+    Uri(const Uri &other) {
         this->operator =(other);
     }
-    URL &operator =(const URL &o) {
+    Uri &operator =(const Uri &o) {
         scheme_ = o.scheme_;
         userInfo_ = o.userInfo_;
         memcpy(host_, o.host_, sizeof(host_));
@@ -81,7 +87,7 @@ public:
     /// the static '/' default URL-path
     static const SBuf &SlashPath();
 
-    /// the static '*' pseudo-URL
+    /// the static '*' pseudo-URI
     static const SBuf &Asterisk();
 
     /**
@@ -119,14 +125,14 @@ private:
      * is to have one prototype URL with no host etc for each scheme,
      * another is to have an explicit scheme class, and then each URL class
      * could be a subclass of the scheme. Another way is one instance of
-     * a AnyP::UriScheme class instance for each URL scheme we support, and one URL
+     * a AnyP::UriScheme class instance for each URL scheme we support, and one
      * class for each manner of treating the scheme : a Hierarchical URL, a
      * non-hierarchical URL etc.
      \par
      * Deferring the decision, its a type code for now. RBC 20060507.
      \par
-     * In order to make taking any of these routes easy, scheme is private
-     * and immutable, only settable at construction time,
+     * In order to make taking any of these routes easy, scheme is private,
+     * only settable at construction time, or with explicit setter
      */
     AnyP::UriScheme scheme_;
 
@@ -141,16 +147,18 @@ private:
     unsigned short port_;   ///< URL port
 
     // XXX: for now includes query-string.
-    SBuf path_;     ///< URL path segment
+    SBuf path_;     ///< URI path segment
 
-    // pre-assembled URL forms
+    // pre-assembled URI forms
     mutable SBuf authorityHttp_;     ///< RFC 7230 section 5.3.3 authority, maybe without default-port
     mutable SBuf authorityWithPort_; ///< RFC 7230 section 5.3.3 authority with explicit port
     mutable SBuf absolute_;          ///< RFC 7230 section 5.3.2 absolute-URI
 };
 
+} // namespace AnyP
+
 inline std::ostream &
-operator <<(std::ostream &os, const URL &url)
+operator <<(std::ostream &os, const AnyP::Uri &url)
 {
     // none means explicit empty string for scheme.
     if (url.getScheme() != AnyP::PROTO_NONE)
@@ -166,8 +174,9 @@ operator <<(std::ostream &os, const URL &url)
     return os;
 }
 
+/* Deprecated functions for Legacy code handling URLs */
+
 class HttpRequest;
-class HttpRequestMethod;
 
 void urlInitialize(void);
 char *urlCanonicalClean(const HttpRequest *);
@@ -221,5 +230,5 @@ int urlCheckRequest(const HttpRequest *);
 char *urlHostname(const char *url);
 void urlExtMethodConfigure(void);
 
-#endif /* SQUID_SRC_URL_H_H */
+#endif /* SQUID_SRC_ANYP_URI_H */
 
index dbf4f0cf5a2d31f6a2da2badff2d1ee5bb6b0315..a10759da15a85e8f4b64ea14706c9b9859317e3b 100644 (file)
@@ -17,6 +17,7 @@ namespace AnyP
 class PortCfg;
 typedef RefCount<PortCfg> PortCfgPointer;
 
+class Uri;
 class UriScheme;
 
 } // namespace AnyP
index 434c541ca2e4c2d1f1a9465dc93ee39a888ed71f..58bfd464e3fa73d0552d9a7ab78932e681e469ab 100644 (file)
@@ -16,7 +16,6 @@
 #include "PeerSelectState.h"
 #include "SquidConfig.h"
 #include "Store.h"
-#include "URL.h"
 
 #include <cmath>
 
index 0ff258707eebb05f215738cf51140bde5b91d5b1..1e173cd61f8a2a72d174242b97c15a899e8acdef 100644 (file)
 #include "Store.h"
 #include "TimeOrTag.h"
 #include "tools.h"
-#include "URL.h"
 
 #if USE_AUTH
 #include "auth/UserRequest.h"
index 2fbbb419326b545397d9eab49e8f8cfdb485f4b8..2a0c71859e216a8d2ea089c16d73b0882f70b5c0 100644 (file)
@@ -37,7 +37,6 @@
 #include "Store.h"
 #include "StrList.h"
 #include "tools.h"
-#include "URL.h"
 #if USE_AUTH
 #include "auth/UserRequest.h"
 #endif
index 52953f22cd08b908170caca83e5adf451005b5bc..36bc0462430b313fc2dd86bf4825a09bbf3498fd 100644 (file)
@@ -54,7 +54,6 @@
 #include "Store.h"
 #include "StrList.h"
 #include "tools.h"
-#include "URL.h"
 #include "wordlist.h"
 #if USE_AUTH
 #include "auth/UserRequest.h"
@@ -1259,7 +1258,7 @@ ClientRequestContext::clientRedirectDone(const Helper::Reply &reply)
 
             // prevent broken helpers causing too much damage. If old URL == new URL skip the re-write.
             if (urlNote != NULL && strcmp(urlNote, http->uri)) {
-                URL tmpUrl;
+                AnyP::Uri tmpUrl;
                 if (tmpUrl.parse(old_request->method, urlNote)) {
                     HttpRequest *new_request = old_request->clone();
                     new_request->url = tmpUrl;
index 207bd8db4c40742507c42bc8e19bbd1e0eaf746f..f77a72bf4bcfcc37c82e80e817196120922b3d1c 100644 (file)
@@ -25,7 +25,6 @@
 #include "StatCounters.h"
 #include "Store.h"
 #include "tools.h"
-#include "URL.h"
 
 #if USE_ADAPTATION
 #include "adaptation/AccessCheck.h"
index 19da1cfb14068b00d20e9919538c47b3eecbab0e..90ab4fbf1b52edbfdc763024bb2bfbbefd81ade0 100644 (file)
@@ -37,7 +37,6 @@
 #include "StatCounters.h"
 #include "Store.h"
 #include "tools.h"
-#include "URL.h"
 #include "util.h"
 #include "wordlist.h"
 
index 5d9d6be9da17abc1a21a4ac334274654b209c101..c81e0a9c01405c0041cc2f95e55540125b744c1d 100644 (file)
@@ -27,7 +27,6 @@
 #include "SquidConfig.h"
 #include "Store.h"
 #include "tools.h"
-#include "URL.h"
 #include "wordlist.h"
 #if USE_AUTH
 #include "auth/UserRequest.h"
index 97613ea06f0835d2f43641abb5c61bf024daa5f8..54a6fb5e3db4406595b52893a2b28065b9f43283 100644 (file)
@@ -35,7 +35,6 @@
 #include "SquidTime.h"
 #include "Store.h"
 #include "tools.h"
-#include "URL.h"
 #include "wordlist.h"
 #if USE_OPENSSL
 #include "ssl/ServerBump.h"
index f1a80800864d245d57388ca4d9ce04e9e2c414a0..619b6b89b3fc3f44c20fd628554d73f0043d0e75 100644 (file)
@@ -27,7 +27,6 @@
 #include "SquidTime.h"
 #include "Store.h"
 #include "tools.h"
-#include "URL.h"
 #if USE_OPENSSL
 #include "ssl/ErrorDetail.h"
 #include "ssl/ServerBump.h"
index 8c42006e72be4949a93fc89722652aee87a9d9cf..56cbc11b93a6ca72fd8f6bfa5d7072b25aa00158 100644 (file)
@@ -35,7 +35,6 @@
 #include "store_key_md5.h"
 #include "StoreClient.h"
 #include "tools.h"
-#include "URL.h"
 
 typedef struct _Countstr Countstr;
 
index f9760a4037a90eb3867642ffe0d478997747d856..f3dcf010a83a7b63c7aa0c27b46a882192d9abab 100644 (file)
@@ -56,7 +56,6 @@
 #include "Store.h"
 #include "StrList.h"
 #include "tools.h"
-#include "URL.h"
 #include "util.h"
 
 #if USE_AUTH
index 66034b76a17a2b9fe95fec10d90ca2aeb8852d2f..e375fc0b83e7b4692cac881db31fbb150d4a9560 100644 (file)
@@ -1084,7 +1084,7 @@ netdbHostData(const char *host, int *samp, int *rtt, int *hops)
 }
 
 void
-netdbUpdatePeer(const URL &url, CachePeer * e, int irtt, int ihops)
+netdbUpdatePeer(const AnyP::Uri &url, CachePeer *e, int irtt, int ihops)
 {
 #if USE_ICMP
     netdbEntry *n;
index 7bd9ab856bceb25581217329bf55a441a91c10a5..ac27f7bcd90a8fc918de9fb7ace60c0f202fecef 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef ICMP_NET_DB_H
 #define ICMP_NET_DB_H
 
+#include "anyp/forward.h"
 #include "hash.h"
 #include "ip/forward.h"
 #include "mem/forward.h"
@@ -18,7 +19,6 @@ class HttpRequest;
 class netdbEntry;
 class PeerSelector;
 class StoreEntry;
-class URL;
 
 class net_db_name:
     public hash_link /* must be first */
@@ -74,7 +74,7 @@ void netdbDump(StoreEntry *);
 void netdbFreeMemory(void);
 int netdbHostHops(const char *host);
 int netdbHostRtt(const char *host);
-void netdbUpdatePeer(const URL &, CachePeer * e, int rtt, int hops);
+void netdbUpdatePeer(const AnyP::Uri &, CachePeer *, int rtt, int hops);
 
 void netdbDeleteAddrNetwork(Ip::Address &addr);
 void netdbBinaryExchange(StoreEntry *);
index 19fedf08f545d2ae921676f08ea8afe34ef5c8b6..6ebc7a67937980cad3e68279db6de8915efcb6ac 100644 (file)
@@ -20,7 +20,6 @@
 #include "SquidTime.h"
 #include "Store.h"
 #include "tools.h"
-#include "URL.h"
 #include "util.h"
 #include "wordlist.h"
 
@@ -108,7 +107,7 @@ internalRemoteUri(const char *host, unsigned short port, const char *dir, const
                 strlen(lc_host) - 1);
 
     /* build URI */
-    URL tmp(AnyP::PROTO_HTTP);
+    AnyP::Uri tmp(AnyP::PROTO_HTTP);
     tmp.host(lc_host);
     if (port)
         tmp.port(port);
index ea5a743f15a3c312a2881f7986d83deca25b385f..b018b64f87dae00495431bd8cd9c0b44cc88834e 100644 (file)
@@ -80,7 +80,6 @@
 #include "StoreFileSystem.h"
 #include "tools.h"
 #include "unlinkd.h"
-#include "URL.h"
 #include "wccp.h"
 #include "wccp2.h"
 #include "WinSvc.h"
index f76bf617b6cfb523f0a07bd2594a72fa6bdc78b3..f55a87ee9264acbecfff2b5b1bcbb08983fe7497 100644 (file)
@@ -44,7 +44,6 @@
 #include "Store.h"
 #include "store_key_md5.h"
 #include "tools.h"
-#include "URL.h"
 
 /* count mcast group peers every 15 minutes */
 #define MCAST_COUNT_RATE 900
@@ -111,7 +110,7 @@ whichPeer(const Ip::Address &from)
 }
 
 peer_t
-neighborType(const CachePeer * p, const URL &url)
+neighborType(const CachePeer * p, const AnyP::Uri &url)
 {
 
     const NeighborTypeDomainList *d = NULL;
@@ -1405,7 +1404,7 @@ peerCountMcastPeersStart(void *data)
     MemObject *mem;
     icp_common_t *query;
     int reqnum;
-    // TODO: use class URL instead of constructing and re-parsing a string
+    // TODO: use class AnyP::Uri instead of constructing and re-parsing a string
     LOCAL_ARRAY(char, url, MAX_URL);
     assert(p->type == PEER_MULTICAST);
     p->mcast.flags.count_event_pending = false;
index f2e748e2017034453056a9d84bb92258b131b1e1..9d982595256c5b8ede1106a4ce9e9f2b8254c41c 100644 (file)
@@ -11,6 +11,7 @@
 #ifndef SQUID_NEIGHBORS_H_
 #define SQUID_NEIGHBORS_H_
 
+#include "anyp/forward.h"
 #include "enums.h"
 #include "ICP.h"
 #include "lookup_t.h"
@@ -20,7 +21,6 @@ class HttpRequest;
 class HttpRequestMethod;
 class CachePeer;
 class StoreEntry;
-class URL;
 class PeerSelector;
 
 CachePeer *getFirstPeer(void);
@@ -55,7 +55,7 @@ void peerNoteDigestLookup(HttpRequest * request, CachePeer * p, lookup_t lookup)
 void peerNoteDigestGone(CachePeer * p);
 int neighborUp(const CachePeer * e);
 const char *neighborTypeStr(const CachePeer * e);
-peer_t neighborType(const CachePeer *, const URL &);
+peer_t neighborType(const CachePeer *, const AnyP::Uri &);
 void peerConnectFailed(CachePeer *);
 void peerConnectSucceded(CachePeer *);
 void dump_peer_options(StoreEntry *, CachePeer *);
index b49f9fd0cc3c52bb7cf76cdffd7e8e94f848fcb3..0f7c0b80c390872464b5f59a289402e2b4fe5382 100644 (file)
@@ -34,7 +34,6 @@
 #include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
-#include "URL.h"
 
 /**
  * A CachePeer which has been selected as a possible destination.
index 0e6285fa82324e0805f586648e3f3c60619268ce..5296dbec252e58913df77a88fbbd55e4a6cef629 100644 (file)
@@ -22,7 +22,6 @@
 #include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
-#include "URL.h"
 #include "util.h"
 
 typedef enum {
index 0a1ee43ec6541c304c3bcc03cb5023fd82f0f9a3..c6ffa94fb6c5cdab2989e4b142e372104c81a60b 100644 (file)
@@ -339,7 +339,7 @@ Ftp::Server::resetLogin(const char *reason)
 void
 Ftp::Server::calcUri(const SBuf *file)
 {
-    // TODO: fill a class URL instead of string
+    // TODO: fill a class AnyP::Uri instead of string
     uri = "ftp://";
     uri.append(host);
     if (port->ftp_track_dirs && master->workingDir.length()) {
index 1c8d61a08f1d403d569bc563ecf5b1175d733754..d5d255398fccb40f2c453d9fc313188447ee715c 100644 (file)
@@ -9,14 +9,13 @@
 /* DEBUG: section 33    Client-side Routines */
 
 #include "squid.h"
-
+#include "anyp/Uri.h"
 #include "client_side.h"
 #include "FwdState.h"
 #include "http/Stream.h"
 #include "ssl/ServerBump.h"
 #include "Store.h"
 #include "StoreClient.h"
-#include "URL.h"
 
 CBDATA_NAMESPACED_CLASS_INIT(Ssl, ServerBump);
 
index 8c9647d061ef7f90322e7c7a893a8d32211ce128..e2cb85264123fd0fdbc7e1f4eede22ed8b765616 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "acl/FilledChecklist.h"
 #include "anyp/PortCfg.h"
+#include "anyp/Uri.h"
 #include "fatal.h"
 #include "fd.h"
 #include "fde.h"
@@ -31,7 +32,6 @@
 #include "ssl/ErrorDetail.h"
 #include "ssl/gadgets.h"
 #include "ssl/support.h"
-#include "URL.h"
 
 #include <cerrno>
 
index b4cde67bbc141c027266f8c190abfdc9b4eeaa21..e80a788111ea0e64e58a68c55e404507024604f8 100644 (file)
@@ -12,7 +12,6 @@
 #include "HttpRequest.h"
 #include "md5.h"
 #include "store_key_md5.h"
-#include "URL.h"
 
 static cache_key null_key[SQUID_MD5_DIGEST_LENGTH];
 
index 5cb3c3ac953108a5155b2c75e596fecf00d5e5b2..f22dd50535dd77dc34e088faba906cf0323093ab 100644 (file)
@@ -41,6 +41,7 @@ STUB_SOURCE= tests/STUB.h \
        tests/stub_ipc.cc \
        tests/stub_ipc_Forwarder.cc \
        tests/stub_ipc_TypedMsgHdr.cc \
+       tests/stub_libanyp.cc \
        tests/stub_libauth_acls.cc \
        tests/stub_libauth.cc \
        tests/stub_libcomm.cc \
@@ -81,7 +82,6 @@ STUB_SOURCE= tests/STUB.h \
        tests/stub_tools.cc \
        tests/stub_tunnel.cc \
        tests/stub_UdsOp.cc \
-       tests/stub_url.cc \
        tests/stub_wccp2.cc \
        tests/stub_whois.cc \
        tests/stub_wordlist.cc 
similarity index 70%
rename from src/tests/stub_url.cc
rename to src/tests/stub_libanyp.cc
index b13435274490d493a67c1a29ff00a32d99d5e434..0a7d347da2bb39895deafb094b91fd6e47d3b20a 100644 (file)
@@ -8,28 +8,28 @@
 
 #include "squid.h"
 
-#define STUB_API "url.cc"
+#define STUB_API "anyp/libanyp.la"
 #include "tests/STUB.h"
 
-#include "URL.h"
-URL::URL(AnyP::UriScheme const &) {STUB}
-void URL::touch() STUB
-bool URL::parse(const HttpRequestMethod&, const char *) STUB_RETVAL(true)
-void URL::host(const char *) STUB
+#include "anyp/Uri.h"
+AnyP::Uri::Uri(AnyP::UriScheme const &) {STUB}
+void AnyP::Uri::touch() STUB
+bool AnyP::Uri::parse(const HttpRequestMethod&, const char *) STUB_RETVAL(true)
+void AnyP::Uri::host(const char *) STUB
 static SBuf nil;
-const SBuf &URL::path() const STUB_RETVAL(nil)
-const SBuf &URL::SlashPath()
+const SBuf &AnyP::Uri::path() const STUB_RETVAL(nil)
+const SBuf &AnyP::Uri::SlashPath()
 {
     static SBuf slash("/");
     return slash;
 }
-const SBuf &URL::Asterisk()
+const SBuf &AnyP::Uri::Asterisk()
 {
     static SBuf asterisk("*");
     return asterisk;
 }
-SBuf &URL::authority(bool) const STUB_RETVAL(nil)
-SBuf &URL::absolute() const STUB_RETVAL(nil)
+SBuf &AnyP::Uri::authority(bool) const STUB_RETVAL(nil)
+SBuf &AnyP::Uri::absolute() const STUB_RETVAL(nil)
 void urlInitialize() STUB
 char *urlCanonicalClean(const HttpRequest *) STUB_RETVAL(nullptr)
 const char *urlCanonicalFakeHttps(const HttpRequest *) STUB_RETVAL(nullptr)
index 66b1ab2e1bcd22b4820f228e3ce948553054db18..87e6d00cbaf18c45abadb05a152fc1876e08c783 100644 (file)
@@ -30,7 +30,7 @@ void netdbDump(StoreEntry *) STUB
 void netdbFreeMemory(void) STUB
 int netdbHostHops(const char *host) STUB_RETVAL(-1)
 int netdbHostRtt(const char *host) STUB_RETVAL(-1)
-void netdbUpdatePeer(const URL &, CachePeer * e, int rtt, int hops) STUB
+void netdbUpdatePeer(const AnyP::Uri &, CachePeer *, int, int) STUB
 void netdbDeleteAddrNetwork(Ip::Address &addr) STUB
 void netdbBinaryExchange(StoreEntry *) STUB
 void netdbExchangeStart(void *) STUB
index de6b59610fdbbfa8c95d87a09615e9e12ffe6d0d..5168dc7446c3f527612a007097476c1167f43e68 100644 (file)
 
 #include <cppunit/TestAssert.h>
 
+#include "anyp/Uri.h"
 #include "Debug.h"
-#include "testURL.h"
+#include "tests/testURL.h"
 #include "unitTestMain.h"
-#include "URL.h"
 
 #include <sstream>
 
@@ -36,11 +36,11 @@ void
 testURL::testConstructScheme()
 {
     AnyP::UriScheme empty_scheme;
-    URL protoless_url(AnyP::PROTO_NONE);
+    AnyP::Uri protoless_url(AnyP::PROTO_NONE);
     CPPUNIT_ASSERT_EQUAL(empty_scheme, protoless_url.getScheme());
 
     AnyP::UriScheme ftp_scheme(AnyP::PROTO_FTP);
-    URL ftp_url(AnyP::PROTO_FTP);
+    AnyP::Uri ftp_url(AnyP::PROTO_FTP);
     CPPUNIT_ASSERT_EQUAL(ftp_scheme, ftp_url.getScheme());
 }
 
@@ -53,10 +53,10 @@ void
 testURL::testDefaultConstructor()
 {
     AnyP::UriScheme aScheme;
-    URL aUrl;
+    AnyP::Uri aUrl;
     CPPUNIT_ASSERT_EQUAL(aScheme, aUrl.getScheme());
 
-    URL *urlPointer = new URL;
+    auto *urlPointer = new AnyP::Uri;
     CPPUNIT_ASSERT(urlPointer != NULL);
     delete urlPointer;
 }
index 68f2acc126ec05765663c7f905f2b5873b225423..8cac2a6a0b2710207a84b4da504644ef10cf0231 100644 (file)
@@ -24,7 +24,6 @@
 #include "Store.h"
 #include "StoreClient.h"
 #include "tools.h"
-#include "URL.h"
 #include "urn.h"
 
 #define URN_REQBUF_SZ   4096
@@ -149,7 +148,7 @@ UrnState::setUriResFromRequest(HttpRequest *r)
     }
 
     SBuf uri = r->url.path();
-    // TODO: use class URL instead of generating a string and re-parsing
+    // TODO: use class AnyP::Uri instead of generating a string and re-parsing
     LOCAL_ARRAY(char, local_urlres, 4096);
     char *host = getHost(uri);
     snprintf(local_urlres, 4096, "http://%s/uri-res/N2L?urn:" SQUIDSBUFPH, host, SQUIDSBUFPRINT(uri));