--------------------- PatchSet 10394 Date: 2008/01/13 14:47:00 Author: adri Branch: s27_adri Tag: (none) Log: Move the clientCheckFollowXForwardedFor() call outside of clientTryParseRequest(). clientCheckFollowXForwardedFor() begins the request rewrite + ACL processing path. SSL tunnel stuff happens in this path. This is being broken out of clientTryParseRequest() so the conn buffer management can be moved out of the parser path and into clientReadRequest(), as part of some general tidying up and restructuring before I convert stuff to using buf_t's. Of course, the bigger problem to look at next is the keepalive logic.. Members: src/client_side.c:1.202.2.9.4.30->1.202.2.9.4.31 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.202.2.9.4.30 retrieving revision 1.202.2.9.4.31 diff -u -r1.202.2.9.4.30 -r1.202.2.9.4.31 --- squid/src/client_side.c 13 Jan 2008 14:15:20 -0000 1.202.2.9.4.30 +++ squid/src/client_side.c 13 Jan 2008 14:47:00 -0000 1.202.2.9.4.31 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.202.2.9.4.30 2008/01/13 14:15:20 adri Exp $ + * $Id: client_side.c,v 1.202.2.9.4.31 2008/01/13 14:47:00 adri Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -3901,7 +3901,7 @@ * <0 : error; stop parsing */ static int -clientTryParseRequest(ConnStateData * conn) +clientTryParseRequest(ConnStateData * conn, clientHttpRequest **chttp) { int fd = conn->fd; int nrequests; @@ -3913,6 +3913,7 @@ request_t *request = NULL; HttpMsgBuf msg; + *chttp = NULL; 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 */ @@ -4081,7 +4082,7 @@ /* Stop reading requests... */ commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0); if (!DLINK_ISEMPTY(conn->reqs) && DLINK_HEAD(conn->reqs) == http) - clientCheckFollowXForwardedFor(http); + *chttp = http; else { debug(33, 1) ("WARNING: pipelined CONNECT request seen from %s\n", inet_ntoa(http->conn->peer.sin_addr)); debugObj(33, 1, "Previous request:\n", ((clientHttpRequest *) DLINK_HEAD(conn->reqs))->request, @@ -4090,7 +4091,7 @@ } return -2; } else { - clientCheckFollowXForwardedFor(http); + *chttp = http; } if (!cbdataValid(conn)) return -1; @@ -4115,6 +4116,8 @@ fde *F = &fd_table[fd]; int len = conn->in.size - conn->in.offset - 1; int ret; + clientHttpRequest *chttp; + debug(33, 4) ("clientReadRequest: FD %d: reading request...\n", fd); if (len == 0) { /* Grow the request memory area to accomodate for a large request */ @@ -4195,9 +4198,13 @@ break; } - ret = clientTryParseRequest(conn); + chttp = NULL; + ret = clientTryParseRequest(conn, &chttp); + if (chttp) + clientCheckFollowXForwardedFor(chttp); if (ret <= 0) break; + } /* while offset > 0 && conn->body.size_left == 0 */ if (!cbdataValid(conn)) { cbdataUnlock(conn);