From 1d85484c3a0db1d82fe0c3a186d07fa10055241a Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Wed, 17 Apr 2002 20:55:21 +0000 Subject: If the initialize_conn() function fails, close the socket and return. Also, changed the call to check_acl() to include the peer's IP and string addresses. --- src/reqs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/reqs.c b/src/reqs.c index 5f2cfec..1d77952 100644 --- a/src/reqs.c +++ b/src/reqs.c @@ -1,4 +1,4 @@ -/* $Id: reqs.c,v 1.60 2002-04-16 03:20:43 rjkaes Exp $ +/* $Id: reqs.c,v 1.61 2002-04-17 20:55:21 rjkaes Exp $ * * This is where all the work in tinyproxy is actually done. Incoming * connections have a new thread created for them. The thread then @@ -1107,10 +1107,12 @@ handle_connection(int fd) getpeer_ip(fd, peer_ipaddr)); connptr = initialize_conn(fd); - if (!connptr) + if (!connptr) { + close(fd); return; + } - if (check_acl(fd) <= 0) { + if (check_acl(fd, peer_ipaddr, peer_string) <= 0) { update_stats(STAT_DENIED); indicate_http_error(connptr, 403, "You do not have authorization for using this service."); -- cgit v1.2.3