From 28dd133623823d216ef681a6a38b5a1c5fe837ac Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Thu, 12 Aug 2004 19:57:15 +0000 Subject: (add_xtinyproxy_header): Removed the runtime error checking of the connptr->server_fd variable and moved it into an assert since we should never be called with invalid data. Also made the function an inline function since it's only called in one place. --- src/reqs.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/reqs.c b/src/reqs.c index e371953..3dd4b1d 100644 --- a/src/reqs.c +++ b/src/reqs.c @@ -1,4 +1,4 @@ -/* $Id: reqs.c,v 1.114 2004-08-11 02:49:05 rjkaes Exp $ +/* $Id: reqs.c,v 1.115 2004-08-12 19:57:15 rjkaes Exp $ * * This is where all the work in tinyproxy is actually done. Incoming * connections have a new child created for them. The child then @@ -978,15 +978,10 @@ pull_client_data(struct conn_s *connptr, long int length) * the server. * -rjkaes */ -static int +static inline int add_xtinyproxy_header(struct conn_s *connptr) { - /* - * Don't try to send if we have an invalid server handle. - */ - if (connptr->server_fd < 0) - return 0; - + assert(connptr && connptr->server_fd >= 0); return write_message(connptr->server_fd, "X-Tinyproxy: %s\r\n", connptr->client_ip_addr); -- cgit v1.2.3