summaryrefslogtreecommitdiff
path: root/src/reqs.c
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-11-26 21:44:43 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-11-26 21:44:43 +0000
commite58343012fa999a33ed2bcfd569fbbe3e861d0a1 (patch)
tree4b66b79746a3ec8a9fced14034db0fbe481425c8 /src/reqs.c
parentc826b18437dfc460e0d360c375241ce65a7ef7f8 (diff)
downloadtinyproxy-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.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/reqs.c b/src/reqs.c
index ebd788e..276f975 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -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.