aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-11-05 10:24:22 +0100
committerDaniel Stenberg <daniel@haxx.se>2010-11-05 10:25:58 +0100
commit87374a47c9d22521c8d31f1c4952db5fdb479903 (patch)
tree6199630ccfaefe19547b2b86975d8c9bb5daf70e /lib/http.c
parent368f5a85474295b22f105430e59979082d7d7662 (diff)
Revert: use Host: name for SNI and cert name checks
This reverts commit b0fd03f5b8d4520dd232a9d13567d16bd0ad8951, 4b2fbe1e97891f, afecd1aa13b4f, 68cde058f66b3
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/http.c b/lib/http.c
index 0804ce050..ed0730c0a 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2254,25 +2254,26 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
ptr = Curl_checkheaders(data, "Host:");
if(ptr && (!data->state.this_is_a_follow ||
Curl_raw_equal(data->state.first_host, conn->host.name))) {
-
+#if !defined(CURL_DISABLE_COOKIES)
/* If we have a given custom Host: header, we extract the host name in
order to possibly use it for cookie reasons later on. We only allow the
custom Host: header if this is NOT a redirect, as setting Host: in the
redirected request is being out on thin ice. Except if the host name
is the same as the first one! */
- char *chost = Curl_copy_header_value(ptr);
- if (!chost)
+ char *cookiehost = Curl_copy_header_value(ptr);
+ if (!cookiehost)
return CURLE_OUT_OF_MEMORY;
- if (!*chost)
+ if (!*cookiehost)
/* ignore empty data */
- free(chost);
+ free(cookiehost);
else {
- char *colon = strchr(chost, ':');
+ char *colon = strchr(cookiehost, ':');
if (colon)
*colon = 0; /* The host must not include an embedded port number */
- Curl_safefree(conn->allocptr.customhost);
- conn->allocptr.customhost = chost;
+ Curl_safefree(conn->allocptr.cookiehost);
+ conn->allocptr.cookiehost = cookiehost;
}
+#endif
conn->allocptr.host = NULL;
}
@@ -2596,8 +2597,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
if(data->cookies) {
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
co = Curl_cookie_getlist(data->cookies,
- conn->allocptr.customhost?
- conn->allocptr.customhost:host,
+ conn->allocptr.cookiehost?
+ conn->allocptr.cookiehost:host,
data->state.path,
(bool)(conn->protocol&PROT_HTTPS?TRUE:FALSE));
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
@@ -3688,8 +3689,8 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
data->cookies, TRUE, k->p+11,
/* If there is a custom-set Host: name, use it
here, or else use real peer host name. */
- conn->allocptr.customhost?
- conn->allocptr.customhost:conn->host.name,
+ conn->allocptr.cookiehost?
+ conn->allocptr.cookiehost:conn->host.name,
data->state.path);
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
}