--------------------- PatchSet 5261 Date: 2002/10/06 11:42:20 Author: rbcollins Branch: commloops Tag: (none) Log: more extractions on ConnStateData Members: src/client_side.c:1.52.4.13->1.52.4.14 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.52.4.13 retrieving revision 1.52.4.14 diff -u -r1.52.4.13 -r1.52.4.14 --- squid/src/client_side.c 6 Oct 2002 11:32:06 -0000 1.52.4.13 +++ squid/src/client_side.c 6 Oct 2002 11:42:20 -0000 1.52.4.14 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.52.4.13 2002/10/06 11:32:06 rbcollins Exp $ + * $Id: client_side.c,v 1.52.4.14 2002/10/06 11:42:20 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1291,7 +1291,6 @@ debug(33, 3) ("clientReadRequest: FD %d aborted, partial request\n", fd); comm_close(fd); - clientMaybeReadData (conn, 0); return; } } @@ -1441,6 +1440,13 @@ } static void +connSetDefer (ConnStateData *conn, size_t milliSeconds) +{ + conn->defer.until = squid_curtime + milliSeconds; + conn->defer.n++; +} + +static void clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno, void *data) { ConnStateData *conn = data; @@ -1464,14 +1470,12 @@ } else if (flag == COMM_OK && size == 0) { if (connFinishedWithConn(conn, size)) { comm_close(fd); - clientMaybeReadData (conn, 0); return; } /* It might be half-closed, we can't tell */ debug(33, 5) ("clientReadRequest: FD %d closed?\n", fd); fd_table[fd].flags.socket_eof = 1; - conn->defer.until = squid_curtime + 1; - conn->defer.n++; + connSetDefer (conn, 1); fd_note(fd, "half-closed"); /* There is one more close check at the end, to detect aborted * (partial) requests. At this point we can't tell if the request @@ -1480,7 +1484,6 @@ /* Continue to process previously read data */ } else if (connReadWasError(conn, flag, size)) { comm_close(fd); - clientMaybeReadData (conn, 0); return; } /* Process request body if any */ @@ -1500,8 +1503,7 @@ /* Limit the number of concurrent requests to 2 */ if (!connOkToAddRequest(conn)) { /* Reset when a request is complete */ - conn->defer.until = squid_curtime + 100; - conn->defer.n++; + connSetDefer (conn, 100); clientMaybeReadData (conn, do_next_read); return; }