]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix crash in TcpAccepter with profiler enabled
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 16 Jul 2015 06:59:08 +0000 (23:59 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 16 Jul 2015 06:59:08 +0000 (23:59 -0700)
src/comm/TcpAcceptor.cc

index 0d5e46b58344d1278bf41974c8e0ed6c93136042..c18ebc5c370518de14101f201f6384e6f87249fb 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;
     }