mirror of
https://github.com/curl/curl.git
synced 2026-08-14 14:23:37 +03:00
urldata: move cookiehost to struct SingleRequest
To make it scoped for the single request appropriately. Reported-by: Muhamad Arga Reksapati Verify with libtest 2504: a custom Host *disabled* on reused handle
This commit is contained in:
parent
0567e72168
commit
2aad1df87f
9 changed files with 159 additions and 12 deletions
12
lib/http.c
12
lib/http.c
|
|
@ -2081,8 +2081,8 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data)
|
|||
if(colon)
|
||||
*colon = 0; /* The host must not include an embedded port number */
|
||||
}
|
||||
curlx_free(aptr->cookiehost);
|
||||
aptr->cookiehost = cookiehost;
|
||||
curlx_free(data->req.cookiehost);
|
||||
data->req.cookiehost = cookiehost;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -2577,8 +2577,8 @@ static CURLcode http_cookies(struct Curl_easy *data,
|
|||
|
||||
if(data->cookies && data->state.cookie_engine) {
|
||||
bool okay;
|
||||
const char *host = data->state.aptr.cookiehost ?
|
||||
data->state.aptr.cookiehost : data->conn->host.name;
|
||||
const char *host = data->req.cookiehost ?
|
||||
data->req.cookiehost : data->conn->host.name;
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
||||
result = Curl_cookie_getlist(data, data->conn, &okay, host, &list);
|
||||
if(!result && okay) {
|
||||
|
|
@ -3578,8 +3578,8 @@ static CURLcode http_header_s(struct Curl_easy *data,
|
|||
if(v) {
|
||||
/* If there is a custom-set Host: name, use it here, or else use
|
||||
* real peer hostname. */
|
||||
const char *host = data->state.aptr.cookiehost ?
|
||||
data->state.aptr.cookiehost : conn->host.name;
|
||||
const char *host = data->req.cookiehost ?
|
||||
data->req.cookiehost : conn->host.name;
|
||||
const bool secure_context = Curl_secure_context(conn, host);
|
||||
CURLcode result;
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue