]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not ApplyTcpKeepAlive() to PortCfg-unrelated traffic (#1006)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 2 Apr 2022 12:10:03 +0000 (12:10 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 2 Apr 2022 12:32:23 +0000 (12:32 +0000)
src/comm/TcpAcceptor.cc

index 8aa57a9d1e02c3a51b5e8d7ba23f953629b6a908..b27f0ac96b28ee2450219073c5b8287c726925b3 100644 (file)
@@ -426,7 +426,8 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
     // set socket flags
     commSetCloseOnExec(sock);
     commSetNonBlocking(sock);
-    Comm::ApplyTcpKeepAlive(sock, listenPort_->tcp_keepalive);
+    if (listenPort_)
+        Comm::ApplyTcpKeepAlive(sock, listenPort_->tcp_keepalive);
 
     /* IFF the socket is (tproxy) transparent, pass the flag down to allow spoofing */
     F->flags.transparent = fd_table[conn->fd].flags.transparent; // XXX: can we remove this line yet?