From 47ab97a3477e3a3090bb80743a2d8143087f1c61 Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Thu, 23 May 2002 18:24:46 +0000 Subject: Fixed up a spelling mistake and changed various bits of code to take advantage of the fact that the peer's socket information is now stored inside the connection structure. --- src/reqs.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/reqs.c b/src/reqs.c index 76db3db..8d253a3 100644 --- a/src/reqs.c +++ b/src/reqs.c @@ -1,4 +1,4 @@ -/* $Id: reqs.c,v 1.73 2002-05-17 16:34:42 rjkaes Exp $ +/* $Id: reqs.c,v 1.74 2002-05-23 18:24:46 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 @@ -31,11 +31,14 @@ #include "conns.h" #include "filter.h" #include "hashmap.h" +#include "heap.h" #include "log.h" +#include "network.h" #include "regexp.h" #include "reqs.h" #include "sock.h" #include "stats.h" +#include "text.h" #include "utils.h" #include "vector.h" @@ -419,7 +422,7 @@ process_request(struct conn_s *connptr) "Proxying refused on filtered domain \"%s\"", request->host); indicate_http_error(connptr, 404, - "Connection to filtered domain is now allowed."); + "Connection to filtered domain is not allowed."); free_request_struct(request); @@ -498,8 +501,6 @@ pull_client_data(struct conn_s *connptr, unsigned long int length) static int add_xtinyproxy_header(struct conn_s *connptr) { - char ipaddr[PEER_IP_LENGTH]; - /* * Don't try to send if we have an invalid server handle. */ @@ -508,7 +509,7 @@ add_xtinyproxy_header(struct conn_s *connptr) return write_message(connptr->server_fd, "X-Tinyproxy: %s\r\n", - getpeer_ip(connptr->client_fd, ipaddr)); + connptr->client_ip_addr); } #endif /* XTINYPROXY */ @@ -1173,12 +1174,12 @@ handle_connection(int fd) char peer_ipaddr[PEER_IP_LENGTH]; char peer_string[PEER_STRING_LENGTH]; + getpeer_information(fd, peer_ipaddr, peer_string); + log_message(LOG_CONN, "Connect (file descriptor %d): %s [%s]", - fd, - getpeer_string(fd, peer_string), - getpeer_ip(fd, peer_ipaddr)); + fd, peer_string, peer_ipaddr); - connptr = initialize_conn(fd); + connptr = initialize_conn(fd, peer_ipaddr, peer_string); if (!connptr) { close(fd); return; -- cgit v1.2.3