--------------------- PatchSet 10667 Date: 2008/07/18 17:59:23 Author: adri Branch: delay_pool_write Tag: (none) Log: Implement a client-side request based delay pool acl. Members: src/cache_cf.c:1.127.2.2->1.127.2.3 src/cf.data.pre:1.259.2.3->1.259.2.4 src/client_side.c:1.236.2.5->1.236.2.6 src/structs.h:1.188.2.4->1.188.2.5 Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.127.2.2 retrieving revision 1.127.2.3 diff -u -r1.127.2.2 -r1.127.2.3 --- squid/src/cache_cf.c 18 Jul 2008 07:04:30 -0000 1.127.2.2 +++ squid/src/cache_cf.c 18 Jul 2008 17:59:23 -0000 1.127.2.3 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.127.2.2 2008/07/18 07:04:30 adri Exp $ + * $Id: cache_cf.c,v 1.127.2.3 2008/07/18 17:59:23 adri Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -1057,6 +1057,7 @@ cfg->class = xcalloc(cfg->pools, sizeof(u_char)); cfg->rates = xcalloc(cfg->pools, sizeof(delaySpecSet *)); cfg->access = xcalloc(cfg->pools, sizeof(acl_access *)); + cfg->accessClientRequest = xcalloc(cfg->pools, sizeof(acl_access *)); cfg->accessClientReply = xcalloc(cfg->pools, sizeof(acl_access *)); } } Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v retrieving revision 1.259.2.3 retrieving revision 1.259.2.4 diff -u -r1.259.2.3 -r1.259.2.4 --- squid/src/cf.data.pre 18 Jul 2008 07:04:30 -0000 1.259.2.3 +++ squid/src/cf.data.pre 18 Jul 2008 17:59:23 -0000 1.259.2.4 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.259.2.3 2008/07/18 07:04:30 adri Exp $ +# $Id: cf.data.pre,v 1.259.2.4 2008/07/18 17:59:23 adri Exp $ # # SQUID Web Proxy Cache http://www.squid-cache.org/ # ---------------------------------------------------------- @@ -4101,6 +4101,20 @@ delay_access 2 deny all DOC_END +NAME: delay_client_request_access +TYPE: delay_pool_access +DEFAULT: none +IFDEF: DELAY_POOLS +LOC: Config.Delay.accessClientRequest +DOC_START + This is used to determine which delay pool a client-side connection + falls into, based on the -request- information. The delay is introduced + on the data being sent to the client regardless of whether the data + is coming from the cache or from an upstream. + + The default is to not client-delay any replies. +DOC_END + NAME: delay_client_reply_access TYPE: delay_pool_access DEFAULT: none @@ -4112,6 +4126,9 @@ on the data being sent to the client regardless of whether the data is coming from the cache or from an upstream. + This is evaluated after delay_client_request_access and may override + the decision in delay_client_request_access. Be careful! + The default is to not client-delay any replies. DOC_END Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.236.2.5 retrieving revision 1.236.2.6 diff -u -r1.236.2.5 -r1.236.2.6 --- squid/src/client_side.c 18 Jul 2008 07:04:31 -0000 1.236.2.5 +++ squid/src/client_side.c 18 Jul 2008 17:59:24 -0000 1.236.2.6 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.236.2.5 2008/07/18 07:04:31 adri Exp $ + * $Id: client_side.c,v 1.236.2.6 2008/07/18 17:59:24 adri Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2806,6 +2806,7 @@ clientSendHeaders(void *data, HttpReply * rep) { //const char *buf = ref.node->data + ref.offset; + delay_id delayid; clientHttpRequest *http = data; StoreEntry *entry = http->entry; ConnStateData *conn = http->conn; @@ -2877,8 +2878,15 @@ #endif #if DELAY_POOLS - /* Write-side Delay Pools: -reply- ACL matching */ - http->delayid = delayClientReply(http, Config.Delay.accessClientReply); + /* Write-side Delay Pools */ + + /* -request- ACL matching */ + http->delayid = delayClientRequest(http, Config.Delay.accessClientRequest); + + /* -reply- ACL matching */ + delayid = delayClientReply(http, Config.Delay.accessClientReply); + if (delayid) + http->delayid = delayid; #endif if (http->log_type != LOG_TCP_DENIED && clientReplyBodyTooLarge(http, rep->content_length)) { Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.188.2.4 retrieving revision 1.188.2.5 diff -u -r1.188.2.4 -r1.188.2.5 --- squid/src/structs.h 16 Jul 2008 12:15:46 -0000 1.188.2.4 +++ squid/src/structs.h 18 Jul 2008 17:59:26 -0000 1.188.2.5 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.188.2.4 2008/07/16 12:15:46 adri Exp $ + * $Id: structs.h,v 1.188.2.5 2008/07/18 17:59:26 adri Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -433,6 +433,7 @@ unsigned char *class; delaySpecSet **rates; acl_access **access; + acl_access **accessClientRequest; acl_access **accessClientReply; };