aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-08-11 19:26:01 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-08-11 19:26:01 +0000
commit019bde82ce8fd9d0a335edb30441088a96906d1b (patch)
tree5462a395d04054e9464aee2cc8511d5b88b4da1d /lib
parentca5e38751c65c29bc94616a86e8d3d6affb8f053 (diff)
- Constantine Sapuntzakis filed bug report #2042440
(http://curl.haxx.se/bug/view.cgi?id=2042440) with a patch. He identified a problem when using NTLM over a proxy but the end-point does Basic, and then libcurl would do wrong when the host sent "Connection: close" as the proxy's NTLM state was erroneously cleared.
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/lib/url.c b/lib/url.c
index c77850794..76603494d 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2179,22 +2179,31 @@ CURLcode Curl_disconnect(struct connectdata *conn)
Curl_expire(data, 0); /* shut off timers */
Curl_hostcache_prune(data); /* kill old DNS cache entries */
- if((conn->ntlm.state != NTLMSTATE_NONE) ||
- (conn->proxyntlm.state != NTLMSTATE_NONE)) {
+ {
+ int has_host_ntlm = (conn->ntlm.state != NTLMSTATE_NONE);
+ int has_proxy_ntlm = (conn->proxyntlm.state != NTLMSTATE_NONE);
+
/* Authentication data is a mix of connection-related and sessionhandle-
related stuff. NTLM is connection-related so when we close the shop
we shall forget. */
- data->state.authhost.done = FALSE;
- data->state.authhost.picked =
- data->state.authhost.want;
- data->state.authproxy.done = FALSE;
- data->state.authproxy.picked =
- data->state.authproxy.want;
+ if (has_host_ntlm) {
+ data->state.authhost.done = FALSE;
+ data->state.authhost.picked =
+ data->state.authhost.want;
+ }
+
+ if (has_proxy_ntlm) {
+ data->state.authproxy.done = FALSE;
+ data->state.authproxy.picked =
+ data->state.authproxy.want;
+ }
- data->state.authproblem = FALSE;
+ if (has_host_ntlm || has_proxy_ntlm) {
+ data->state.authproblem = FALSE;
- Curl_ntlm_cleanup(conn);
+ Curl_ntlm_cleanup(conn);
+ }
}
if(conn->handler->disconnect)