From: Daniel Stenberg Date: Wed, 28 Jul 2004 21:13:29 +0000 (+0000) Subject: Fixes Brian Akins' reported problems with duplicate Host: headers on re-used X-Git-Tag: upstream/7.37.1~12278 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7bed4fc7c8b734c66a731a49f92ee4c9b9ba707;p=platform%2Fupstream%2Fcurl.git Fixes Brian Akins' reported problems with duplicate Host: headers on re-used connections. --- diff --git a/lib/http.c b/lib/http.c index d1128d4..4b3e7df 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. */