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
This commit is contained in:
parent
381aff0385
commit
5278462c32
11
lib/http.c
11
lib/http.c
@ -645,10 +645,10 @@ output_auth_headers(struct connectdata *conn,
|
|||||||
proxy ? "Proxy" : "Server", auth,
|
proxy ? "Proxy" : "Server", auth,
|
||||||
proxy ? (conn->http_proxy.user ? conn->http_proxy.user : "") :
|
proxy ? (conn->http_proxy.user ? conn->http_proxy.user : "") :
|
||||||
(conn->user ? conn->user : ""));
|
(conn->user ? conn->user : ""));
|
||||||
authstatus->multi = (!authstatus->done) ? TRUE : FALSE;
|
authstatus->multipass = (!authstatus->done) ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
authstatus->multi = FALSE;
|
authstatus->multipass = FALSE;
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
@ -1426,6 +1426,11 @@ CURLcode Curl_http_done(struct connectdata *conn,
|
|||||||
struct Curl_easy *data = conn->data;
|
struct Curl_easy *data = conn->data;
|
||||||
struct HTTP *http = data->req.protop;
|
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);
|
Curl_unencode_cleanup(conn);
|
||||||
|
|
||||||
#ifdef USE_SPNEGO
|
#ifdef USE_SPNEGO
|
||||||
@ -1862,7 +1867,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
|||||||
if(result)
|
if(result)
|
||||||
return 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_GET) &&
|
||||||
(httpreq != HTTPREQ_HEAD)) {
|
(httpreq != HTTPREQ_HEAD)) {
|
||||||
/* Auth is required and we are not authenticated yet. Make a PUT or POST
|
/* Auth is required and we are not authenticated yet. Make a PUT or POST
|
||||||
|
|||||||
@ -1283,8 +1283,8 @@ struct auth {
|
|||||||
this resource */
|
this resource */
|
||||||
bool done; /* TRUE when the auth phase is done and ready to do the *actual*
|
bool done; /* TRUE when the auth phase is done and ready to do the *actual*
|
||||||
request */
|
request */
|
||||||
bool multi; /* TRUE if this is not yet authenticated but within the auth
|
bool multipass; /* TRUE if this is not yet authenticated but within the
|
||||||
multipass negotiation */
|
auth multipass negotiation */
|
||||||
bool iestyle; /* TRUE if digest should be done IE-style or FALSE if it should
|
bool iestyle; /* TRUE if digest should be done IE-style or FALSE if it should
|
||||||
be RFC compliant */
|
be RFC compliant */
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user