diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-11-26 21:44:43 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-11-26 21:44:43 +0000 |
commit | e58343012fa999a33ed2bcfd569fbbe3e861d0a1 (patch) | |
tree | 4b66b79746a3ec8a9fced14034db0fbe481425c8 /src/reqs.c | |
parent | c826b18437dfc460e0d360c375241ce65a7ef7f8 (diff) | |
download | tinyproxy-e58343012fa999a33ed2bcfd569fbbe3e861d0a1.tar.gz tinyproxy-e58343012fa999a33ed2bcfd569fbbe3e861d0a1.zip |
Included code to disable the sending of the Via header. This is now
controlled by the ViaHeader configure directive.
Diffstat (limited to '')
-rw-r--r-- | src/reqs.c | 31 |
1 files changed, 18 insertions, 13 deletions
@@ -1,4 +1,4 @@ -/* $Id: reqs.c,v 1.85 2002-11-13 17:48:48 rjkaes Exp $ +/* $Id: reqs.c,v 1.86 2002-11-26 21:44:43 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 @@ -791,7 +791,7 @@ process_client_headers(struct conn_s *connptr, hashmap_t hashofheaders) int i; hashmap_iter iter; long content_length = -1; - int ret; + int ret = 0; char *data, *header; @@ -826,13 +826,15 @@ process_client_headers(struct conn_s *connptr, hashmap_t hashofheaders) } /* Send, or add the Via header */ - ret = write_via_header(connptr->server_fd, hashofheaders, - connptr->protocol.major, - connptr->protocol.minor); - if (ret < 0) { - indicate_http_error(connptr, 503, - "Could not send data to remote server."); - goto PULL_CLIENT_DATA; + if (config.via_http_header) { + ret = write_via_header(connptr->server_fd, hashofheaders, + connptr->protocol.major, + connptr->protocol.minor); + if (ret < 0) { + indicate_http_error(connptr, 503, + "Could not send data to remote server."); + goto PULL_CLIENT_DATA; + } } /* @@ -969,10 +971,13 @@ process_server_headers(struct conn_s *connptr) } /* Send, or add the Via header */ - ret = write_via_header(connptr->client_fd, hashofheaders, - connptr->protocol.major, connptr->protocol.minor); - if (ret < 0) - goto ERROR_EXIT; + if (config.via_http_header) { + ret = write_via_header(connptr->client_fd, hashofheaders, + connptr->protocol.major, + connptr->protocol.minor); + if (ret < 0) + goto ERROR_EXIT; + } /* * All right, output all the remaining headers to the client. |