diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2004-08-12 19:57:15 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2004-08-12 19:57:15 +0000 |
commit | 28dd133623823d216ef681a6a38b5a1c5fe837ac (patch) | |
tree | a6ba27873e8fac12ee30bc8d33d775e4634e4e20 /src/reqs.c | |
parent | 924da17c1771f95509d5e1c64286fa8f6e4ba76f (diff) |
(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.
Diffstat (limited to 'src/reqs.c')
-rw-r--r-- | src/reqs.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -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); |