aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorIsaac Boukris <iboukris@gmail.com>2015-05-31 23:21:15 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-05-31 23:21:15 +0200
commit4bb815a32ed1fa20dec415b3b018ff18c014c19c (patch)
tree574abd71a450269816a17e55cbf4e1a9b080ad15 /lib/http.c
parent4e7c3c12d32ad3e8d939dfd2fcd7fca84d42cd9c (diff)
HTTP-NTLM: fail auth on connection close instead of looping
Bug: https://github.com/bagder/curl/issues/256
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/http.c b/lib/http.c
index ef55364ee..8e422f0bf 100644
--- a/lib/http.c
+++ b/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.