[Privoxy-commits] [privoxy] 10/38: Change block_acl()'s prototype and move csp to the beginning

User Git git at git.privoxy.org
Thu Apr 9 09:37:08 CEST 2026


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

commit d333318cda159135872f033b3466d96763616580
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Fri Jun 10 11:54:44 2022 +0200

    Change block_acl()'s prototype and move csp to the beginning
    
    ... to be more consistent.
---
 filters.c   | 8 ++++----
 filters.h   | 2 +-
 jbsockets.c | 4 ++--
 jcc.c       | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/filters.c b/filters.c
index ff21f4c5..71f70247 100644
--- a/filters.c
+++ b/filters.c
@@ -238,15 +238,15 @@ static int match_sockaddr(const struct sockaddr_storage *network,
  *                Decide yes or no based on ACL file.
  *
  * Parameters  :
- *          1  :  dst = The proxy or gateway address this is going to.
- *                      Or NULL to check all possible targets.
- *          2  :  csp = Current client state (buffers, headers, etc...)
+ *          1  :  csp = Current client state (buffers, headers, etc...)
  *                      Also includes the client IP address.
+ *          2  :  dst = The proxy or gateway address this is going to.
+ *                      Or NULL to check all possible targets.
  *
  * Returns     : 0 = FALSE (don't block (yet)) and 1 = TRUE (do block)
  *
  *********************************************************************/
-int block_acl(const struct access_control_addr *dst, const struct client_state *csp)
+int block_acl(const struct client_state *csp, const struct access_control_addr *dst)
 {
    struct access_control_list *acl = csp->config->acl;
 
diff --git a/filters.h b/filters.h
index 54873afc..6e27a696 100644
--- a/filters.h
+++ b/filters.h
@@ -40,7 +40,7 @@
  * ACL checking
  */
 #ifdef FEATURE_ACL
-extern int block_acl(const struct access_control_addr *dst, const struct client_state *csp);
+extern int block_acl(const struct client_state *csp, const struct access_control_addr *dst);
 extern int acl_addr(const char *aspec, struct access_control_addr *aca);
 #endif /* def FEATURE_ACL */
 
diff --git a/jbsockets.c b/jbsockets.c
index c98a1f6b..02598b81 100644
--- a/jbsockets.c
+++ b/jbsockets.c
@@ -258,7 +258,7 @@ static jb_socket rfc2553_connect_to(const char *host, int portnum, struct client
 #ifdef FEATURE_ACL
       memcpy(&dst->addr, rp->ai_addr, rp->ai_addrlen);
 
-      if (block_acl(dst, csp))
+      if (block_acl(csp, dst))
       {
          socket_error = errno = EPERM;
          continue;
@@ -468,7 +468,7 @@ static jb_socket no_rfc2553_connect_to(const char *host, int portnum, struct cli
    dst->addr = ntohl(addr);
    dst->port = portnum;
 
-   if (block_acl(dst, csp))
+   if (block_acl(csp, dst))
    {
       errno = EPERM;
       return(JB_INVALID_SOCKET);
diff --git a/jcc.c b/jcc.c
index 50d7339d..2fab1249 100644
--- a/jcc.c
+++ b/jcc.c
@@ -6319,7 +6319,7 @@ static void listen_loop(void)
       }
 
 #ifdef FEATURE_ACL
-      if (block_acl(NULL,csp))
+      if (block_acl(csp, NULL))
       {
          log_error(LOG_LEVEL_CONNECT,
             "Connection from %s on %s (socket %d) dropped due to ACL",

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list