--------------------- PatchSet 10478 Date: 2008/03/30 13:41:02 Author: adri Branch: s2_delaywork Tag: (none) Log: Make the new delay pools stuff dependant on #if DELAY_POOLS being defined. Members: src/cache_cf.c:1.114.2.1->1.114.2.2 src/cf.data.pre:1.240.2.1->1.240.2.2 src/client_side.c:1.223.2.1->1.223.2.2 Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.114.2.1 retrieving revision 1.114.2.2 diff -u -r1.114.2.1 -r1.114.2.2 --- squid/src/cache_cf.c 25 Mar 2008 11:33:28 -0000 1.114.2.1 +++ squid/src/cache_cf.c 30 Mar 2008 13:41:02 -0000 1.114.2.2 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.114.2.1 2008/03/25 11:33:28 adri Exp $ + * $Id: cache_cf.c,v 1.114.2.2 2008/03/30 13:41:02 adri Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2510,6 +2510,7 @@ dlinkAddTail(bs, &bs->node, bodylist); } +#if DELAY_POOLS CBDATA_TYPE(delay_body_size); static void @@ -2531,6 +2532,7 @@ dlinkAddTail(dbs, &dbs->node, bodylist); } +#endif static void dump_body_size_t(StoreEntry * entry, const char *name, dlink_list bodylist) @@ -2555,6 +2557,7 @@ } } +#if DELAY_POOLS static void dump_delay_body_size_t(StoreEntry * entry, const char *name, dlink_list bodylist) { @@ -2578,7 +2581,7 @@ dbs = (delay_body_size *) dbs->node.next; } } - +#endif static void free_body_size_t(dlink_list * bodylist) @@ -2595,6 +2598,7 @@ } } +#if DELAY_POOLS static void free_delay_body_size_t(dlink_list * bodylist) { @@ -2610,6 +2614,7 @@ dbs = tempnode; } } +#endif static int @@ -2618,11 +2623,13 @@ return bodylist.head == NULL; } +#if DELAY_POOLS static int check_null_delay_body_size_t(dlink_list bodylist) { return bodylist.head == NULL; } +#endif static void Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v retrieving revision 1.240.2.1 retrieving revision 1.240.2.2 diff -u -r1.240.2.1 -r1.240.2.2 --- squid/src/cf.data.pre 25 Mar 2008 11:33:29 -0000 1.240.2.1 +++ squid/src/cf.data.pre 30 Mar 2008 13:41:04 -0000 1.240.2.2 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.240.2.1 2008/03/25 11:33:29 adri Exp $ +# $Id: cf.data.pre,v 1.240.2.2 2008/03/30 13:41:04 adri Exp $ # # SQUID Web Proxy Cache http://www.squid-cache.org/ # ---------------------------------------------------------- @@ -915,6 +915,7 @@ NAME: delay_body_max_size COMMENT: bytes delay_pool allow|deny acl acl... TYPE: delay_body_size_t +IFDEF: DELAY_POOLS DEFAULT: none DEFAULT_IF_NONE: 0 0 allow all LOC: Config.DelayBodySize Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.223.2.1 retrieving revision 1.223.2.2 diff -u -r1.223.2.1 -r1.223.2.2 --- squid/src/client_side.c 25 Mar 2008 11:33:32 -0000 1.223.2.1 +++ squid/src/client_side.c 30 Mar 2008 13:41:06 -0000 1.223.2.2 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.223.2.1 2008/03/25 11:33:32 adri Exp $ + * $Id: client_side.c,v 1.223.2.2 2008/03/30 13:41:06 adri Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2681,6 +2681,7 @@ } } +#if DELAY_POOLS /* * Calculates the delay maximum size allowed for an HTTP response */ @@ -2710,6 +2711,7 @@ aclChecklistFree(checklist); } } +#endif static int clientReplyBodyTooLarge(clientHttpRequest * http, squid_off_t clen) @@ -2723,6 +2725,7 @@ return 0; } +#if DELAY_POOLS static int clientDelayBodyTooLarge(clientHttpRequest * http, squid_off_t clen) { @@ -2734,6 +2737,7 @@ return 1; /* too large */ return 0; } +#endif static int clientRequestBodyTooLarge(squid_off_t clen) @@ -2825,7 +2829,9 @@ return; } clientMaxBodySize(http->request, http, rep); +#if DELAY_POOLS clientDelayMaxBodySize(http->request, http, rep); +#endif if (http->log_type != LOG_TCP_DENIED && clientReplyBodyTooLarge(http, rep->content_length)) { ErrorState *err = errorCon(ERR_TOO_BIG, HTTP_FORBIDDEN, http->orig_request); storeClientUnregister(http->sc, http->entry, http); @@ -3294,16 +3300,16 @@ /* 4096 is a margin for the HTTP headers included in out.offset */ comm_close(fd); } else { +#if DELAY_POOLS debug(33, 5) ("clientWriteComplete : Normal\n"); if (clientDelayBodyTooLarge(http, http->out.offset - 4096)) { debug(33, 5) ("clientWriteComplete: we should put this into the pool: DelayId=%i\n", http->sc->delay_id); -#if DELAY_POOLS delayUnregisterDelayIdPtr(&http->sc->delay_id); delaySetStoreClient(http->sc, delayPoolClient(http->delayAssignedPool, (in_addr_t) http->conn->peer.sin_addr.s_addr)); -#endif } +#endif /* More data will be coming from primary server; register with * storage manager. */ if (EBIT_TEST(entry->flags, ENTRY_ABORTED))