mirror of
https://github.com/curl/curl.git
synced 2026-05-03 22:57:51 +03:00
HTTP-NTLM: fail auth on connection close instead of looping
Bug: https://github.com/bagder/curl/issues/256
This commit is contained in:
parent
4e7c3c12d3
commit
4bb815a32e
2 changed files with 17 additions and 24 deletions
13
lib/http.c
13
lib/http.c
|
|
@ -3087,6 +3087,19 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
|||
}
|
||||
}
|
||||
|
||||
/* At this point we have some idea about the fate of the connection.
|
||||
If we are closing the connection it may result auth failure. */
|
||||
#if defined(USE_NTLM)
|
||||
if(conn->bits.close &&
|
||||
(((data->req.httpcode == 401) &&
|
||||
(conn->ntlm.state == NTLMSTATE_TYPE2)) ||
|
||||
((data->req.httpcode == 407) &&
|
||||
(conn->proxyntlm.state == NTLMSTATE_TYPE2)))) {
|
||||
infof(data, "Connection closure while negotiating auth (HTTP 1.0?)\n");
|
||||
data->state.authproblem = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When all the headers have been parsed, see if we should give
|
||||
* up and return an error.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue