summaryrefslogtreecommitdiffhomepage
path: root/src/acl.h
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2018-12-31 15:47:40 +0000
committerrofl0r <rofl0r@users.noreply.github.com>2019-12-21 00:43:45 +0000
commitf6d4da5d81694721bf50b2275621e7ce84e6da30 (patch)
tree1874b1b9e979167074f4831f83bd58c5529a9924 /src/acl.h
parent82e10935d2955923d419cb46ee97e0022a8dfdb0 (diff)
do hostname resolution only when it is absolutely necessary for ACL check
tinyproxy used to do a full hostname resolution whenever a new client connection happened, which could cause very long delays (as reported in #198). there's only a single place/scenario that actually requires a hostname, and that is when an Allow/Deny rule exists for a hostname or domain, rather than a raw IP address. since it is very likely this feature is not very widely used, it makes absolute sense to only do the costly resolution when it is unavoidable.
Diffstat (limited to 'src/acl.h')
-rw-r--r--src/acl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/acl.h b/src/acl.h
index 2d11cef..ba0aebe 100644
--- a/src/acl.h
+++ b/src/acl.h
@@ -22,12 +22,13 @@
#define TINYPROXY_ACL_H
#include "vector.h"
+#include "sock.h"
typedef enum { ACL_ALLOW, ACL_DENY } acl_access_t;
extern int insert_acl (char *location, acl_access_t access_type,
vector_t *access_list);
-extern int check_acl (const char *ip_address, const char *string_address,
+extern int check_acl (const char *ip_address, union sockaddr_union *addr,
vector_t access_list);
extern void flush_access_list (vector_t access_list);