From: chi-mf <43963496+chi-mf@users.noreply.github.com> Date: Thu, 25 Oct 2018 13:33:06 +0000 (+0000) Subject: Update netdb when tunneling requests (#314) X-Git-Tag: SQUID_4_5~12 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=052395d73216e8da08fcb872017081a9c7ad2cc6;p=thirdparty%2Fsquid.git Update netdb when tunneling requests (#314) 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. --- diff --git a/src/tunnel.cc b/src/tunnel.cc index 4b4cf4460e..1d8feecd3b 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -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" @@ -1037,6 +1038,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;