--------------------- PatchSet 12136 Date: 2008/05/26 23:14:30 Author: hno Branch: SQUID_2_7 Tag: (none) Log: Bug #219: Reassign delay pools after reconfigure This patch tries to reassign requests to delay pools after reconfigure, making sure that pending requests still get delayed proper. Members: src/client_side.c:1.754.2.11->1.754.2.12 src/main.c:1.403.2.1->1.403.2.2 src/protos.h:1.547.2.5->1.547.2.6 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid/squid/src/client_side.c,v retrieving revision 1.754.2.11 retrieving revision 1.754.2.12 diff -u -r1.754.2.11 -r1.754.2.12 --- squid/src/client_side.c 26 May 2008 22:47:40 -0000 1.754.2.11 +++ squid/src/client_side.c 26 May 2008 23:14:30 -0000 1.754.2.12 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.754.2.11 2008/05/26 22:47:40 hno Exp $ + * $Id: client_side.c,v 1.754.2.12 2008/05/26 23:14:30 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -5172,3 +5172,21 @@ comm_remove_close_handler(fd, clientPinnedConnectionClosed, conn); return fd; } + +#if DELAY_POOLS +void +clientReassignDelaypools(void) +{ + dlink_node *i; + for (i = ClientActiveRequests.head; i; i = i->next) { + clientHttpRequest *http = i->data; + assert(http); + if (http->sc && http->log_type != LOG_TCP_DENIED && http->log_type != LOG_TAG_NONE) + delaySetStoreClient(http->sc, delayClient(http)); + if (http->reply) + http->delayMaxBodySize = 0; + http->delayAssignedPool = 0; + clientDelayMaxBodySize(http->request, http, http->reply); + } +} +#endif Index: squid/src/main.c =================================================================== RCS file: /cvsroot/squid/squid/src/main.c,v retrieving revision 1.403.2.1 retrieving revision 1.403.2.2 diff -u -r1.403.2.1 -r1.403.2.2 --- squid/src/main.c 3 Jan 2008 02:30:06 -0000 1.403.2.1 +++ squid/src/main.c 26 May 2008 23:14:30 -0000 1.403.2.2 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.403.2.1 2008/01/03 02:30:06 hno Exp $ + * $Id: main.c,v 1.403.2.2 2008/05/26 23:14:30 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -438,6 +438,9 @@ #if USE_WCCPv2 wccp2Init(); #endif +#if DELAY_POOLS + clientReassignDelaypools(); +#endif serverConnectionsOpen(); neighbors_init(); storeDirOpenSwapLogs(); Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid/squid/src/protos.h,v retrieving revision 1.547.2.5 retrieving revision 1.547.2.6 diff -u -r1.547.2.5 -r1.547.2.6 --- squid/src/protos.h 21 Apr 2008 02:49:44 -0000 1.547.2.5 +++ squid/src/protos.h 26 May 2008 23:14:30 -0000 1.547.2.6 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.547.2.5 2008/04/21 02:49:44 hno Exp $ + * $Id: protos.h,v 1.547.2.6 2008/05/26 23:14:30 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -147,6 +147,7 @@ extern void clientPinConnection(ConnStateData * conn, int fd, const request_t * request, peer * peer, int auth); extern int clientGetPinnedInfo(const ConnStateData * conn, const request_t * request, peer ** peer); extern int clientGetPinnedConnection(ConnStateData * conn, const request_t * request, const peer * peer, int *auth); +extern void clientReassignDelaypools(void); extern int commSetNonBlocking(int fd); extern int commUnsetNonBlocking(int fd);