]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix crash in TcpAccepter with profiler enabled
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 4 Jul 2015 11:36:00 +0000 (04:36 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 4 Jul 2015 11:36:00 +0000 (04:36 -0700)
src/comm/TcpAcceptor.cc

index 15e3e40cf154017eada44f3f6cecf44b5bec6d96..ce96f16cafbb0b7f3a90ced28050a46940920111 100644 (file)
@@ -366,6 +366,7 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
         if (clientdbEstablished(details->remote, 0) > Config.client_ip_max_connections) {
             debugs(50, DBG_IMPORTANT, "WARNING: " << details->remote << " attempting more than " << Config.client_ip_max_connections << " connections.");
             Ip::Address::FreeAddr(gai);
+            PROF_stop(comm_accept);
             return Comm::COMM_ERROR;
         }
     }
@@ -376,6 +377,7 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
     if (getsockname(sock, gai->ai_addr, &gai->ai_addrlen) != 0) {
         debugs(50, DBG_IMPORTANT, "ERROR: getsockname() failed to locate local-IP on " << details << ": " << xstrerror());
         Ip::Address::FreeAddr(gai);
+        PROF_stop(comm_accept);
         return Comm::COMM_ERROR;
     }
     details->local = *gai;
@@ -405,6 +407,7 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
     // Perform NAT or TPROXY operations to retrieve the real client/dest IP addresses
     if (conn->flags&(COMM_TRANSPARENT|COMM_INTERCEPTION) && !Ip::Interceptor.Lookup(details, conn)) {
         // Failed.
+        PROF_stop(comm_accept);
         return Comm::COMM_ERROR;
     }