]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #2044 fix: Detect aborted client connections.
authorrousskov <>
Sat, 18 Aug 2007 02:28:49 +0000 (02:28 +0000)
committerrousskov <>
Sat, 18 Aug 2007 02:28:49 +0000 (02:28 +0000)
Call clientAfterReadingRequests even if we parsed the request. Otherwise, we
will not set up a read handler to detect aborted connections.

Do not call clientAfterReadingRequests() after comm_close() because the
former uses the file descriptor to look things up.

src/client_side.cc

index 2f8dc6a5c8b6c4a53a2486afad6606c396f1f623..0c0d84dac89ec65b6a97ed501483b71bcf28b914 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.759 2007/08/13 18:25:14 hno Exp $
+ * $Id: client_side.cc,v 1.760 2007/08/17 20:28:49 rousskov Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -2503,10 +2503,11 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno,
         if (conn->getConcurrentRequestCount() == 0 && commIsHalfClosed(fd)) {
             debugs(33, 5, "clientReadRequest: FD " << fd << ": half-closed connection, no completed request parsed, connection closing.");
             comm_close(fd);
+            return;
         }
-
-        clientAfterReadingRequests(fd, conn, do_next_read);
     }
+
+    clientAfterReadingRequests(fd, conn, do_next_read);
 }
 
 // called when new request data has been read from the socket