summaryrefslogtreecommitdiff
path: root/lib/c-hyper.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-05-31 15:11:27 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-06-01 18:03:37 +0200
commit83036d86af2efaf57b9e722179f03604a873dc84 (patch)
treed3dd502b98361deae86867bdc4ee3b87ebef9dff /lib/c-hyper.c
parentdddad339e8a56722babb5864b39a83f293f6491a (diff)
downloadcurl-83036d86af2efaf57b9e722179f03604a873dc84.tar.gz
c-hyper: fix NTLM on closed connection tested with test159
Closes #7154
Diffstat (limited to 'lib/c-hyper.c')
-rw-r--r--lib/c-hyper.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/c-hyper.c b/lib/c-hyper.c
index 0f307f3e8..4de93838d 100644
--- a/lib/c-hyper.c
+++ b/lib/c-hyper.c
@@ -166,6 +166,18 @@ static int hyper_body_chunk(void *userdata, const hyper_buf *chunk)
if(0 == k->bodywrites++) {
bool done = FALSE;
+#if defined(USE_NTLM)
+ struct connectdata *conn = data->conn;
+ if(conn->bits.close &&
+ (((data->req.httpcode == 401) &&
+ (conn->http_ntlm_state == NTLMSTATE_TYPE2)) ||
+ ((data->req.httpcode == 407) &&
+ (conn->proxy_ntlm_state == NTLMSTATE_TYPE2)))) {
+ infof(data, "Connection closed while negotiating NTLM\n");
+ data->state.authproblem = TRUE;
+ Curl_safefree(data->req.newurl);
+ }
+#endif
result = Curl_http_firstwrite(data, data->conn, &done);
if(result || done) {
infof(data, "Return early from hyper_body_chunk\n");