diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-06-15 11:28:17 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-06-15 22:56:25 +0200 |
commit | e15e51384a423be31318b3c9c7d612a1aae661fd (patch) | |
tree | 58d9a981811efc730b9768d87419df738cb21f10 /lib/http_negotiate.c | |
parent | 350a99b21f8c89db2d027d9a5c83ed5df72d65ea (diff) | |
download | curl-e15e51384a423be31318b3c9c7d612a1aae661fd.tar.gz |
http: move header storage to Curl_easy from connectdata
Since the connection can be used by many independent requests (using
HTTP/2 or HTTP/3), things like user-agent and other transfer-specific
data MUST NOT be kept connection oriented as it could lead to requests
getting the wrong string for their requests. This struct data was
lingering like this due to old HTTP1 legacy thinking where it didn't
mattered..
Fixes #5566
Closes #5567
Diffstat (limited to 'lib/http_negotiate.c')
-rw-r--r-- | lib/http_negotiate.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index 915be06bf..0a19ec2af 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -123,7 +123,8 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy) struct auth *authp = proxy ? &conn->data->state.authproxy : &conn->data->state.authhost; curlnegotiate *state = proxy ? &conn->proxy_negotiate_state : - &conn->http_negotiate_state; + &conn->http_negotiate_state; + struct Curl_easy *data = conn->data; char *base64 = NULL; size_t len = 0; char *userp; @@ -168,15 +169,15 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy) return result; userp = aprintf("%sAuthorization: Negotiate %s\r\n", proxy ? "Proxy-" : "", - base64); + base64); if(proxy) { - Curl_safefree(conn->allocptr.proxyuserpwd); - conn->allocptr.proxyuserpwd = userp; + Curl_safefree(data->state.aptr.proxyuserpwd); + data->state.aptr.proxyuserpwd = userp; } else { - Curl_safefree(conn->allocptr.userpwd); - conn->allocptr.userpwd = userp; + Curl_safefree(data->state.aptr.userpwd); + data->state.aptr.userpwd = userp; } free(base64); |