summaryrefslogtreecommitdiff
path: root/src/reqs.c
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-17 20:55:21 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-17 20:55:21 +0000
commit1d85484c3a0db1d82fe0c3a186d07fa10055241a (patch)
tree2feed3536f955d3503bdb32ed38d3dcaca82142e /src/reqs.c
parent42098699db17c543bc92001c4659a783f174dc7d (diff)
downloadtinyproxy-1d85484c3a0db1d82fe0c3a186d07fa10055241a.tar.gz
tinyproxy-1d85484c3a0db1d82fe0c3a186d07fa10055241a.zip
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.
Diffstat (limited to '')
-rw-r--r--src/reqs.c8
1 files 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.");