diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-04-17 20:55:21 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-04-17 20:55:21 +0000 |
commit | 1d85484c3a0db1d82fe0c3a186d07fa10055241a (patch) | |
tree | 2feed3536f955d3503bdb32ed38d3dcaca82142e | |
parent | 42098699db17c543bc92001c4659a783f174dc7d (diff) | |
download | tinyproxy-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.
-rw-r--r-- | src/reqs.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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."); |