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.
This commit is contained in:
rofl0r authored and rofl0r committed 2019-12-21 00:43:45 +00:00
1 parent 82e10935d2
commit f6d4da5d81
11 files changed
+40 -51

No files matched your search

+1 -3
View File
@@ -62,10 +62,9 @@ struct conn_s {
char *server_ip_addr;
/*
* Store the client's IP and hostname information
* Store the client's IP information
*/
char *client_ip_addr;
char *client_string_addr;
/*
* Store the incoming request's HTTP protocol.
@@ -92,7 +91,6 @@ struct conn_s {
* Functions for the creation and destruction of a connection structure.
*/
extern struct conn_s *initialize_conn (int client_fd, const char *ipaddr,
const char *string_addr,
const char *sock_ipaddr);
extern void destroy_conn (struct conn_s *connptr);