]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Update netdb when tunneling requests (#314) M-staged-PR314
authorchi-mf <43963496+chi-mf@users.noreply.github.com>
Thu, 25 Oct 2018 13:33:06 +0000 (13:33 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 27 Oct 2018 08:06:36 +0000 (08:06 +0000)
Updating netdb on tunneled transactions (e.g., CONNECT requests) is
especially important for origin servers that are only reached via
tunnels. Without updates, requests for such sites may always through a
cache_peer, even if a direct connection to them is much faster.

src/tunnel.cc

index c1e30aa193c112607e162de4fa1b3e63f76601e8..6717dcd049b62904e3598a84242dd37746126cff 100644 (file)
@@ -27,6 +27,7 @@
 #include "globals.h"
 #include "http.h"
 #include "http/Stream.h"
+#include "icmp/net_db.h"
 #include "HttpRequest.h"
 #include "ip/QosConfig.h"
 #include "LogTags.h"
@@ -1050,6 +1051,8 @@ tunnelConnectDone(const Comm::ConnectionPointer &conn, Comm::Flag status, int xe
         tunnelState->server.setDelayId(DelayId());
 #endif
 
+    netdbPingSite(tunnelState->request->url.host());
+
     tunnelState->request->hier.resetPeerNotes(conn, tunnelState->getHost());
 
     tunnelState->server.conn = conn;