]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
move whitespace-skipping block inside the while loop below it so we skip
authorwessels <>
Thu, 20 Aug 1998 05:07:23 +0000 (05:07 +0000)
committerwessels <>
Thu, 20 Aug 1998 05:07:23 +0000 (05:07 +0000)
leading whitespace on following requests, and work around broken user
agents which send too many CRLF on a POST

src/client_side.cc

index ca48c263bdad143b0b20bce3374fbd338c6820f5..0ef3017910c82a0b1655a81f0baec59a877fc41f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.382 1998/08/17 19:19:33 wessels Exp $
+ * $Id: client_side.cc,v 1.383 1998/08/19 23:07:23 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1983,14 +1983,16 @@ clientReadRequest(int fd, void *data)
     }
     conn->in.offset += size;
     /* Skip leading (and trailing) whitespace */
-    while (conn->in.offset > 0 && isspace(conn->in.buf[0])) {
-       xmemmove(conn->in.buf, conn->in.buf + 1, conn->in.offset - 1);
-       conn->in.offset--;
-    }
-    conn->in.buf[conn->in.offset] = '\0';      /* Terminate the string */
     while (conn->in.offset > 0) {
        int nrequests;
        size_t req_line_sz;
+       while (conn->in.offset > 0 && isspace(conn->in.buf[0])) {
+           xmemmove(conn->in.buf, conn->in.buf + 1, conn->in.offset - 1);
+           conn->in.offset--;
+       }
+       conn->in.buf[conn->in.offset] = '\0';   /* Terminate the string */
+       if (conn->in.offset == 0)
+           break;
        /* Limit the number of concurrent requests to 2 */
        for (H = &conn->chr, nrequests = 0; *H; H = &(*H)->next, nrequests++);
        if (nrequests >= 2) {