]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
moved clientAccessCheck() call to AFTER a block for non-GET
authorwessels <>
Mon, 17 Aug 1998 22:38:07 +0000 (22:38 +0000)
committerwessels <>
Mon, 17 Aug 1998 22:38:07 +0000 (22:38 +0000)
requests to copy body bytes and maybe disable read handlers.

This was done because in the experimental optimistic-IO code,
the request is DONE after the clientAccessCheck call, and the
request data structure has been freed, resulting in FMR's etc.

It works here only because we have at least one select loop
without optimistic IO before the request is complete.

src/client_side.cc

index 86aafde9292fd4ee7c840372c0535cfa3c76150b..b3a6fe6ab4113edcbc8938372c5ed77aa5171af6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.378 1998/08/16 06:35:15 wessels Exp $
+ * $Id: client_side.cc,v 1.379 1998/08/17 16:38:07 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -2101,7 +2101,6 @@ clientReadRequest(int fd, void *data)
                break;
            }
            http->request = requestLink(request);
-           clientAccessCheck(http);
            /*
             * break here for NON-GET because most likely there is a
             * reqeust body following and we don't want to parse it
@@ -2120,12 +2119,14 @@ clientReadRequest(int fd, void *data)
                        xmemmove(conn->in.buf, conn->in.buf + copy_len, conn->in.offset);
                }
                /*
-                * ick; cancel the read handler for NON-GET requests
-                * until this request is forwarded/resolved
+                * if we didn't get the full body now, then more will
+                * be arriving on the client socket.  Lets cancel
+                * the read handler until this request gets forwarded.
                 */
-               commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
-               break;
+               if (request->body_sz < cont_len)
+                   commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
            }
+           clientAccessCheck(http);
            continue;           /* while offset > 0 */
        } else if (parser_return_code == 0) {
            /*