Skip to content

Commit 33e4398

Browse files
icingbagder
authored andcommitted
url: improve connection reuse on negotiate
Check state of negotiate to allow proper connection reuse. Closes #21203
1 parent b27e828 commit 33e4398

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

lib/url.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,11 +1085,17 @@ static bool url_match_auth_ntlm(struct connectdata *conn,
10851085
if(m->want_ntlm_http) {
10861086
if(Curl_timestrcmp(m->needle->user, conn->user) ||
10871087
Curl_timestrcmp(m->needle->passwd, conn->passwd)) {
1088-
10891088
/* we prefer a credential match, but this is at least a connection
1090-
that can be reused and "upgraded" to NTLM */
1091-
if(conn->http_ntlm_state == NTLMSTATE_NONE)
1089+
that can be reused and "upgraded" to NTLM if it does
1090+
not have any auth ongoing. */
1091+
#ifdef USE_SPNEGO
1092+
if((conn->http_ntlm_state == NTLMSTATE_NONE)
1093+
&& (conn->http_negotiate_state == GSS_AUTHNONE)) {
1094+
#else
1095+
if(conn->http_ntlm_state == NTLMSTATE_NONE) {
1096+
#endif
10921097
m->found = conn;
1098+
}
10931099
return FALSE;
10941100
}
10951101
}

0 commit comments

Comments
 (0)