summaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-10-21 10:43:03 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-10-23 10:15:39 +0200
commit807c056c08bd6314e27148c348d027a808e3a632 (patch)
tree2be32daeee2278ae3940e3bb1ea0da99d66bf824 /lib/url.c
parent2838fd91bef9f776816f2c06e36488f153825a8f (diff)
downloadcurl-807c056c08bd6314e27148c348d027a808e3a632.tar.gz
conn-reuse: requests wanting NTLM can reuse non-NTLM connections
Added test case 338 to verify. Reported-by: Daniel Silverstone Fixes #4499 Closes #4514
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index 1b3c15c2f..660d24141 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1282,8 +1282,14 @@ ConnectionExists(struct Curl_easy *data,
partway through a handshake!) */
if(wantNTLMhttp) {
if(strcmp(needle->user, check->user) ||
- strcmp(needle->passwd, check->passwd))
+ strcmp(needle->passwd, check->passwd)) {
+
+ /* we prefer a credential match, but this is at least a connection
+ that can be reused and "upgraded" to NTLM */
+ if(check->http_ntlm_state == NTLMSTATE_NONE)
+ chosen = check;
continue;
+ }
}
else if(check->http_ntlm_state != NTLMSTATE_NONE) {
/* Connection is using NTLM auth but we don't want NTLM */