From: robertc <> Date: Thu, 15 May 2003 12:22:42 +0000 (+0000) Subject: Summary: Delay client assignment was incorrectly reusing a checklist. X-Git-Tag: SQUID_3_0_PRE1~193 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ec8c6a2ad5d80dcff49b2d2406d64ac96ee8392;p=thirdparty%2Fsquid.git Summary: Delay client assignment was incorrectly reusing a checklist. Keywords: Delay client assignment was incorrectly reusing a checklist. --- diff --git a/src/DelayId.cc b/src/DelayId.cc index 10a7ec0d7f..0618e70ccf 100644 --- a/src/DelayId.cc +++ b/src/DelayId.cc @@ -1,6 +1,6 @@ /* - * $Id: DelayId.cc,v 1.6 2003/03/10 20:12:43 robertc Exp $ + * $Id: DelayId.cc,v 1.7 2003/05/15 06:22:42 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -89,8 +89,9 @@ DelayId::operator bool() const return pool_ || compositeId.getRaw(); } +/* create a delay Id for a given request */ DelayId -DelayId::DelayClient(clientHttpRequest * http) +DelayId::DelayClient(clientHttpRequest * http, DelayPools *poolSet) { request_t *r; unsigned short pool; @@ -102,23 +103,25 @@ DelayId::DelayClient(clientHttpRequest * http) return DelayId(); } - ACLChecklist ch; - ch.src_addr = r->client_addr; - ch.my_addr = r->my_addr; - ch.my_port = r->my_port; + for (pool = 0; pool < poolSet->pools(); pool++) { + ACLChecklist ch; + ch.src_addr = r->client_addr; + ch.my_addr = r->my_addr; + ch.my_port = r->my_port; - if (http->conn) - ch.conn(cbdataReference(http->conn)); + if (http->conn) + ch.conn(cbdataReference(http->conn)); - ch.request = requestLink(r); + ch.request = requestLink(r); - for (pool = 0; pool < DelayPools::pools(); pool++) - if (DelayPools::delay_data[pool].theComposite().getRaw() && - aclCheckFast(DelayPools::delay_data[pool].access, &ch)) { + if (poolSet->pool(pool).theComposite().getRaw() && + aclCheckFast(poolSet->pool(pool).access, &ch)) { DelayId result (pool + 1); - result.compositePosition(DelayPools::delay_data[pool].theComposite()->id(ch.src_addr, r->auth_user_request)); + result.compositePosition(poolSet->pool(pool).theComposite()->id(ch.src_addr, r->auth_user_request)); return result; } + } + return DelayId(); }