aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-03-09 16:48:18 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-03-09 16:48:18 +0000
commitac0bad2433a35c274cf8ad14e158251b88817b33 (patch)
tree046b23045409ac651557a32be8e4c75e4625c3fa
parent67d5c0a9700d67ecb4ceee137aeeb27b683121a2 (diff)
remake Host: for each connection and it'll work with proxies too
-rw-r--r--lib/http.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/http.c b/lib/http.c
index 2da7cbf72..52b009d3e 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -469,10 +469,14 @@ CURLcode Curl_http(struct connectdata *conn)
http->sendit = Curl_getFormData(data->httppost, &http->postsize);
}
- if(!checkheaders(data, "Host:") &&
- !conn->allocptr.host) {
- /* if ptr_host is already set, it is OK since we only re-use connections
- to the very same host and port */
+ if(!checkheaders(data, "Host:")) {
+ /* if ptr_host is already set, it is almost OK since we only re-use
+ connections to the very same host and port, but when we use a HTTP
+ proxy we have a persistant connect and yet we must change the Host:
+ header! */
+
+ if(conn->allocptr.host)
+ free(conn->allocptr.host);
if(((conn->protocol&PROT_HTTPS) && (conn->remote_port == PORT_HTTPS)) ||
(!(conn->protocol&PROT_HTTPS) && (conn->remote_port == PORT_HTTP)) )