]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed startup assertions when using a src_as or dst_as ACL (#397)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Mon, 29 Apr 2019 18:59:23 +0000 (18:59 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 30 Apr 2019 09:21:45 +0000 (09:21 +0000)
Specify the port for generated whois URLs when requesting AS numbers.

src/acl/Asn.cc
src/anyp/Uri.h
src/whois.cc

index dc2dd07a6bf1754dfb9b36a423222fa8e2dec8b8..6a2af66277154c28ad24874a2b1c26ba4b6073a3 100644 (file)
@@ -28,7 +28,6 @@
 #include "Store.h"
 #include "StoreClient.h"
 
-#define WHOIS_PORT 43
 #ifndef AS_REQBUF_SZ
 #define AS_REQBUF_SZ    4096
 #endif
@@ -229,6 +228,7 @@ asnCacheStart(int as)
 {
     AnyP::Uri whoisUrl(AnyP::PROTO_WHOIS);
     whoisUrl.host(Config.as_whois_server);
+    whoisUrl.defaultPort();
 
     SBuf asPath("/!gAS");
     asPath.appendf("%d", as);
index 1a8f05715bfd16933508c743ae055cd6c99f3ba6..5765f7e453b21d2045dbda5fdad9b8d151c9a43f 100644 (file)
@@ -82,6 +82,8 @@ public:
 
     void port(unsigned short p) {port_=p; touch();}
     unsigned short port() const {return port_;}
+    /// reset the port to the default port number for the current scheme
+    void defaultPort() { port(getScheme().defaultPort()); }
 
     void path(const char *p) {path_=p; touch();}
     void path(const SBuf &p) {path_=p; touch();}
index 448d7238b34e6f3f635fb84ee206abb2318b75e6..e6f8946d1ae4bdf5a79c8056bd5b43684f453b82 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <cerrno>
 
-#define WHOIS_PORT 43
-
 class WhoisState
 {
     CBDATA_CLASS(WhoisState);