]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanups triggered by http_reply_access fix in 2.5. All client_side
authorhno <>
Thu, 3 Oct 2002 12:45:53 +0000 (12:45 +0000)
committerhno <>
Thu, 3 Oct 2002 12:45:53 +0000 (12:45 +0000)
code dealing with access list should use clientAclChecklistCreate to
avoid having to duplicate the same checklist initialization everywhere

src/client_side.cc
src/client_side_reply.cc
src/client_side_request.cc
src/protos.h

index df1acd96d00eb2ba16cfc0bf5c6c94b5c3015dc4..f3bfb302758d7fd96f5e62203faaa9567f0f9642 100644 (file)
@@ -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;
+}
+
index 75f2f0eadb9befe076c701521771694e0a1dd1b9..9ea25fe6311441385fc2f8fe4911d8c59e997bea 100644 (file)
@@ -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;
index 836d376a97fe5d9dad5cf8efee083f671083c0e1..e73160e96b9f2c4c595fe1082cdc280451855b5f 100644 (file)
@@ -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)
index f9ec8550ade768bd4ee0404a78caa5636a49aaa0..ba9524b76f614851e2021a32b3815e58bfbe9e06 100644 (file)
@@ -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);