]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #2068: assertion failed: comm.cc:2286: "fdc_table[fd].active"
authorhno <>
Mon, 3 Sep 2007 09:13:52 +0000 (09:13 +0000)
committerhno <>
Mon, 3 Sep 2007 09:13:52 +0000 (09:13 +0000)
A recent change opened for a race condition on PUT/POST requests.

src/client_side.cc

index 9b6b1cc9be80a16a5866e3cd25d931956be1fd38..70128711710027a394b16f1ce63847f3ed055e9a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.764 2007/08/30 15:57:16 hno Exp $
+ * $Id: client_side.cc,v 1.765 2007/09/03 03:13:52 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -2454,6 +2454,10 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno,
 
             conn->handleReadData(buf, size);
 
+           /* The above may close the connection under our feets */
+           if (!conn->isOpen())
+               return;
+
         } else if (size == 0) {
             debugs(33, 5, "clientReadRequest: FD " << fd << " closed?");
 
@@ -2484,6 +2488,8 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno,
         fd_note(conn->fd, "Reading next request");
 
     if (! clientParseRequest(conn, do_next_read)) {
+       if (!conn->isOpen())
+           return;
         /*
          * If the client here is half closed and we failed
          * to parse a request, close the connection.
@@ -2491,7 +2497,6 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno,
          * succeeds _if_ the buffer is empty which it won't
          * be if we have an incomplete request.
          */
-
         if (conn->getConcurrentRequestCount() == 0 && commIsHalfClosed(fd)) {
             debugs(33, 5, "clientReadRequest: FD " << fd << ": half-closed connection, no completed request parsed, connection closing.");
             comm_close(fd);