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: M-staged-PR314 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35a2465736faf294a2daa4f10f3e1bee6511bdaf;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 c1e30aa193..6717dcd049 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" @@ -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;