From: hno <> Date: Thu, 3 Oct 2002 12:45:53 +0000 (+0000) Subject: Cleanups triggered by http_reply_access fix in 2.5. All client_side X-Git-Tag: SQUID_3_0_PRE1~712 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28d4805a1b88fba45ea0b4dfde0d5341978fb1e6;p=thirdparty%2Fsquid.git Cleanups triggered by http_reply_access fix in 2.5. All client_side code dealing with access list should use clientAclChecklistCreate to avoid having to duplicate the same checklist initialization everywhere --- diff --git a/src/client_side.cc b/src/client_side.cc index df1acd96d0..f3bfb30275 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.596 2002/09/27 11:21:09 robertc Exp $ + * $Id: client_side.cc,v 1.597 2002/10/03 06:45:53 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2042,3 +2042,28 @@ varyEvaluateMatch(StoreEntry * entry, request_t * request) } } } + +aclCheck_t * +clientAclChecklistCreate(const acl_access * acl, const clientHttpRequest * http) +{ + aclCheck_t *ch; + ConnStateData *conn = http->conn; + ch = aclChecklistCreate(acl, http->request, conn ? conn->rfc931 : dash_str); + + /* + * hack for ident ACL. It needs to get full addresses, and a place to store + * the ident result on persistent connections... + */ + /* connection oriented auth also needs these two lines for it's operation. */ + /* + * Internal requests do not have a connection reference, because: A) their + * byte count may be transformed before being applied to an outbound + * connection B) they are internal - any limiting on them should be done on + * the server end. + */ + if (conn) + ch->conn = cbdataReference(conn); /* unreferenced in acl.c */ + + return ch; +} + diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 75f2f0eadb..9ea25fe631 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.11 2002/09/29 11:29:41 robertc Exp $ + * $Id: client_side_reply.cc,v 1.12 2002/10/03 06:45:53 hno Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -1504,10 +1504,8 @@ clientSendMoreData(void *data, StoreIOBuffer result) 3) ("clientSendMoreData: Appending %d bytes after %d bytes of headers\n", (int) body_size, rep->hdr_sz); - ch = aclChecklistCreate(Config.accessList.reply, http->request, NULL); + ch = clientAclChecklistCreate(Config.accessList.reply, http->request, NULL); ch->reply = rep; - if (http->conn) - ch->conn = cbdataReference(http->conn); /* acl.c frees */ rv = aclCheckFast(Config.accessList.reply, ch); aclChecklistFree(ch); ch = NULL; diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 836d376a97..e73160e96b 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.cc,v 1.5 2002/09/24 10:46:43 robertc Exp $ + * $Id: client_side_request.cc,v 1.6 2002/10/03 06:45:53 hno Exp $ * * DEBUG: section 85 Client-side Request Routines AUTHOR: Robert Collins * (Originally Duane Wessels in client_side.c) @@ -66,9 +66,6 @@ FREE clientRequestContextFree; /* other */ static int checkAccelOnly(clientHttpRequest *); static void clientAccessCheckDone(int, void *); - /* static */ aclCheck_t * - clientAclChecklistCreate(const acl_access * acl, - const clientHttpRequest * http); static int clientCachable(clientHttpRequest * http); static int clientHierarchical(clientHttpRequest * http); static void clientInterpretRequestHeaders(clientHttpRequest * http); @@ -196,30 +193,6 @@ checkAccelOnly(clientHttpRequest * http) return 1; } -aclCheck_t * -clientAclChecklistCreate(const acl_access * acl, const clientHttpRequest * http) -{ - aclCheck_t *ch; - ConnStateData *conn = http->conn; - ch = aclChecklistCreate(acl, http->request, conn ? conn->rfc931 : dash_str); - - /* - * hack for ident ACL. It needs to get full addresses, and a place to store - * the ident result on persistent connections... - */ - /* connection oriented auth also needs these two lines for it's operation. */ - /* - * Internal requests do not have a connection reference, because: A) their - * byte count may be transformed before being applied to an outbound - * connection B) they are internal - any limiting on them should be done on - * the server end. - */ - if (conn) - ch->conn = cbdataReference(conn); /* unreferenced in acl.c */ - - return ch; -} - /* This is the entry point for external users of the client_side routines */ void clientAccessCheck(void *data) diff --git a/src/protos.h b/src/protos.h index f9ec8550ad..ba9524b76f 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.448 2002/09/26 13:33:08 robertc Exp $ + * $Id: protos.h,v 1.449 2002/10/03 06:45:53 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -136,7 +136,6 @@ extern void clientdbDump(StoreEntry *); extern void clientdbFreeMemory(void); extern int clientdbEstablished(struct in_addr, int); -extern void clientAccessCheck(void *); extern char *clientConstructTraceEcho(clientHttpRequest *); extern void clientOpenListenSockets(void); extern void clientHttpConnectionsClose(void); @@ -144,6 +143,9 @@ extern void clientReadBody(request_t * req, char *buf, size_t size, CBCB * callb extern int clientAbortBody(request_t * req); extern void httpRequestFree(void *); +extern void clientAccessCheck(void *); +extern aclCheck_t * clientAclChecklistCreate(const acl_access * acl, const clientHttpRequest * http); + /* client_side_reply.c - client side reply related routines (pure logic, no comms) */ extern void *clientReplyNewContext(clientHttpRequest *); extern int clientHttpRequestStatus(int fd, clientHttpRequest const *http);