aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-07-28 21:13:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-07-28 21:13:29 +0000
commita7bed4fc7c8b734c66a731a49f92ee4c9b9ba707 (patch)
treed10939547740bb4fc8757c0991f7f1fbd5cc13aa
parent7ca49dc91d932e2695a796b00d3189f2b0504603 (diff)
Fixes Brian Akins' reported problems with duplicate Host: headers on re-used
connections.
-rw-r--r--lib/http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index d1128d499..4b3e7dfb4 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1351,6 +1351,8 @@ CURLcode Curl_http(struct connectdata *conn)
}
}
+ Curl_safefree(conn->allocptr.host);
+
ptr = checkheaders(data, "Host:");
if(ptr && !data->state.this_is_a_follow) {
/* If we have a given custom Host: header, we extract the host name in
@@ -1374,10 +1376,10 @@ CURLcode Curl_http(struct connectdata *conn)
memcpy(conn->allocptr.cookiehost, start, len);
conn->allocptr.cookiehost[len]=0;
}
+
+ conn->allocptr.host = NULL;
}
else {
- Curl_safefree(conn->allocptr.host);
-
/* When building Host: headers, we must put the host name within
[brackets] if the host name is a plain IPv6-address. RFC2732-style. */