--------------------- PatchSet 10393 Date: 2008/01/13 14:15:20 Author: adri Branch: s27_adri Tag: (none) Log: Shuffle whitespace trimming out of TryParseRequest(). Members: src/client_side.c:1.202.2.9.4.29->1.202.2.9.4.30 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.202.2.9.4.29 retrieving revision 1.202.2.9.4.30 diff -u -r1.202.2.9.4.29 -r1.202.2.9.4.30 --- squid/src/client_side.c 13 Jan 2008 12:24:37 -0000 1.202.2.9.4.29 +++ squid/src/client_side.c 13 Jan 2008 14:15:20 -0000 1.202.2.9.4.30 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.202.2.9.4.29 2008/01/13 12:24:37 adri Exp $ + * $Id: client_side.c,v 1.202.2.9.4.30 2008/01/13 14:15:20 adri Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -3914,14 +3914,6 @@ HttpMsgBuf msg; - /* Skip leading (and trailing) whitespace */ - while (conn->in.offset > 0 && xisspace(conn->in.buf[0])) { - xmemmove(conn->in.buf, conn->in.buf + 1, conn->in.offset - 1); - conn->in.offset--; - } - if (conn->in.offset == 0) - return 0; - HttpMsgBufInit(&msg, conn->in.buf, conn->in.offset); /* XXX for now there's no deallocation function needed but this may change */ /* Limit the number of concurrent requests to 2 */ for (n = conn->reqs.head, nrequests = 0; n; n = n->next, nrequests++); @@ -4192,6 +4184,17 @@ ret = 0; while (cbdataValid(conn) && conn->in.offset > 0 && conn->body.size_left == 0) { /* Ret tells us how many bytes was consumed - 0 == didn't consume request, > 0 == consumed, -1 == error, -2 == CONNECT request stole the connection */ + + /* Skip leading (and trailing) whitespace */ + while (conn->in.offset > 0 && xisspace(conn->in.buf[0])) { + xmemmove(conn->in.buf, conn->in.buf + 1, conn->in.offset - 1); + conn->in.offset--; + } + if (conn->in.offset == 0) { + ret = 0; + break; + } + ret = clientTryParseRequest(conn); if (ret <= 0) break;