From: Eduard Bagdasaryan Date: Mon, 29 Apr 2019 18:59:23 +0000 (+0000) Subject: Fixed startup assertions when using a src_as or dst_as ACL (#397) X-Git-Tag: SQUID_5_0_1~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d754c7af16ae3fdc8ab5b9f6842572e1d27e8854;p=thirdparty%2Fsquid.git Fixed startup assertions when using a src_as or dst_as ACL (#397) Specify the port for generated whois URLs when requesting AS numbers. --- diff --git a/src/acl/Asn.cc b/src/acl/Asn.cc index dc2dd07a6b..6a2af66277 100644 --- a/src/acl/Asn.cc +++ b/src/acl/Asn.cc @@ -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); diff --git a/src/anyp/Uri.h b/src/anyp/Uri.h index 1a8f05715b..5765f7e453 100644 --- a/src/anyp/Uri.h +++ b/src/anyp/Uri.h @@ -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();} diff --git a/src/whois.cc b/src/whois.cc index 448d7238b3..e6f8946d1a 100644 --- a/src/whois.cc +++ b/src/whois.cc @@ -23,8 +23,6 @@ #include -#define WHOIS_PORT 43 - class WhoisState { CBDATA_CLASS(WhoisState);