--------------------- PatchSet 7083 Date: 2005/10/09 07:18:14 Author: adri Branch: tidyup_deferred_reads Tag: (none) Log: * just so I can see whether I've 'messed up' my server-side code, httpTimeout() now logs to level '1' so I notice whenever a server socket times out. * shift around the new code a little so I don't need to pre-declare functions just to compile it * Actually enable the kicking and waiting for the HTTP server side. There's probably a few edge cases that need to be looked at and I believe they'll all manifest as timed out connections during my testing - ie, I call the kick callback with STKICK_WAIT, removing the comm IO event and don't ever re-register it. This stuff is being tested with a simple datacomm-1 polygraph workload. Members: src/http.c:1.17.6.27.4.13->1.17.6.27.4.14 Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.17.6.27.4.13 retrieving revision 1.17.6.27.4.14 diff -u -r1.17.6.27.4.13 -r1.17.6.27.4.14 --- squid/src/http.c 9 Oct 2005 07:05:00 -0000 1.17.6.27.4.13 +++ squid/src/http.c 9 Oct 2005 07:18:14 -0000 1.17.6.27.4.14 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.17.6.27.4.13 2005/10/09 07:05:00 adri Exp $ + * $Id: http.c,v 1.17.6.27.4.14 2005/10/09 07:18:14 adri Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -98,7 +98,7 @@ { HttpStateData *httpState = data; StoreEntry *entry = httpState->entry; - debug(11, 4) ("httpTimeout: FD %d: '%s'\n", fd, storeUrl(entry)); + debug(11, 1) ("httpTimeout: FD %d: '%s'\n", fd, storeUrl(entry)); if (entry->store_status == STORE_PENDING) { fwdFail(httpState->fwd, errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT)); @@ -559,6 +559,14 @@ commSetSelect(fd, COMM_SELECT_READ, httpReadReply, httpState, 0); } +void +httpReadClear(int fd, HttpStateData *httpState) +{ + httpState->pending_read = 0; + assert(fd == httpState->fd); + commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0); +} + static void httpReadKick(StoreEntry *e, void *data, store_kick_type_t type) { @@ -568,15 +576,13 @@ * This won't be very efficient as we may already /have/ scheduled IO, * but we can cross that bridge when we know this works. */ -// httpReadSchedule(httpState->fd, httpState); -} - -void -httpReadClear(int fd, HttpStateData *httpState) -{ - httpState->pending_read = 0; - assert(fd == httpState->fd); - commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0); + if (type == STKICK_WAIT) { + httpReadClear(httpState->fd, httpState); + } else if (type == STKICK_RUN || type == STKICK_FETCH) { + httpReadSchedule(httpState->fd, httpState); + } else { + fatal("httpReadKick: unknown IO kick type!\n"); + } } /* This will be called when data is ready to be read from fd. Read until @@ -809,7 +815,6 @@ httpSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data) { HttpStateData *httpState = data; - StoreEntry *entry = httpState->entry; debug(11, 5) ("httpSendComplete: FD %d: size %d: errflag %d.\n", fd, (int) size, errflag); #if URL_CHECKSUM_DEBUG