summaryrefslogtreecommitdiffhomepage
path: root/src/reqs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reqs.c')
-rw-r--r--src/reqs.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/reqs.c b/src/reqs.c
index 8450cff..c576412 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -1533,7 +1533,7 @@ get_request_entity(struct conn_s *connptr)
* tinyproxy code, which was confusing, redundant. Hail progress.
* - rjkaes
*/
-void handle_connection (int fd)
+void handle_connection (int fd, union sockaddr_union* addr)
{
ssize_t i;
struct conn_s *connptr;
@@ -1542,26 +1542,25 @@ void handle_connection (int fd)
char sock_ipaddr[IP_LENGTH];
char peer_ipaddr[IP_LENGTH];
- char peer_string[HOSTNAME_LENGTH];
- getpeer_information (fd, peer_ipaddr, peer_string);
+ getpeer_information (addr, peer_ipaddr, sizeof(peer_ipaddr));
if (config.bindsame)
getsock_ip (fd, sock_ipaddr);
log_message (LOG_CONN, config.bindsame ?
- "Connect (file descriptor %d): %s [%s] at [%s]" :
- "Connect (file descriptor %d): %s [%s]",
- fd, peer_string, peer_ipaddr, sock_ipaddr);
+ "Connect (file descriptor %d): %s at [%s]" :
+ "Connect (file descriptor %d): %s",
+ fd, peer_ipaddr, sock_ipaddr);
- connptr = initialize_conn (fd, peer_ipaddr, peer_string,
+ connptr = initialize_conn (fd, peer_ipaddr,
config.bindsame ? sock_ipaddr : NULL);
if (!connptr) {
close (fd);
return;
}
- if (check_acl (peer_ipaddr, peer_string, config.access_list) <= 0) {
+ if (check_acl (peer_ipaddr, addr, config.access_list) <= 0) {
update_stats (STAT_DENIED);
indicate_http_error (connptr, 403, "Access denied",
"detail",