aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorIsaac Boukris <iboukris@gmail.com>2017-01-27 00:42:28 +0200
committerMichael Kaufmann <mail@michael-kaufmann.ch>2017-03-11 18:12:08 +0100
commit5278462c32a70cd972a8cc824a38f164151d6c6d (patch)
treef34ed7e53b43fd64b8ead5bcd2416ed6a22bbf91 /lib/http.c
parent381aff03857544b05c34f3f095089cd170023978 (diff)
authneg: clear auth.multi flag at http_done
This flag is meant for the current request based on authentication state, once the request is done we can clear the flag. Also change auth.multi to auth.multipass for better readability. Fixes https://github.com/curl/curl/issues/1095 Closes https://github.com/curl/curl/pull/1326 Signed-off-by: Isaac Boukris <iboukris@gmail.com> Reported-by: Michael Kaufmann
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/http.c b/lib/http.c
index fbb0376a3..ebc005060 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -645,10 +645,10 @@ output_auth_headers(struct connectdata *conn,
proxy ? "Proxy" : "Server", auth,
proxy ? (conn->http_proxy.user ? conn->http_proxy.user : "") :
(conn->user ? conn->user : ""));
- authstatus->multi = (!authstatus->done) ? TRUE : FALSE;
+ authstatus->multipass = (!authstatus->done) ? TRUE : FALSE;
}
else
- authstatus->multi = FALSE;
+ authstatus->multipass = FALSE;
return CURLE_OK;
}
@@ -1426,6 +1426,11 @@ CURLcode Curl_http_done(struct connectdata *conn,
struct Curl_easy *data = conn->data;
struct HTTP *http = data->req.protop;
+ /* Clear multipass flag. If authentication isn't done yet, then it will get
+ * a chance to be set back to true when we output the next auth header */
+ data->state.authhost.multipass = FALSE;
+ data->state.authproxy.multipass = FALSE;
+
Curl_unencode_cleanup(conn);
#ifdef USE_SPNEGO
@@ -1862,7 +1867,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
if(result)
return result;
- if((data->state.authhost.multi || data->state.authproxy.multi) &&
+ if((data->state.authhost.multipass || data->state.authproxy.multipass) &&
(httpreq != HTTPREQ_GET) &&
(httpreq != HTTPREQ_HEAD)) {
/* Auth is required and we are not authenticated yet. Make a PUT or POST