aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-04 07:52:53 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-04 07:52:53 +0000
commitfc6eff13b5414caf6edf22d73a3239e074a04216 (patch)
treeeada47ce6b65dee31800734c70220bf22c8deec3 /lib/url.c
parente7ee1ccf4596a37a2278e523d0da7652ab43a42c (diff)
General HTTP authentication cleanup and fixes
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/url.c b/lib/url.c
index 7962d264e..df07f538a 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1332,9 +1332,12 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
CURLcode Curl_disconnect(struct connectdata *conn)
{
+ struct SessionHandle *data;
if(!conn)
return CURLE_OK; /* this is closed and fine already */
+ data = conn->data;
+
/*
* The range string is usually freed in curl_done(), but we might
* get here *instead* if we fail prematurely. Thus we need to be able
@@ -1346,11 +1349,20 @@ CURLcode Curl_disconnect(struct connectdata *conn)
}
if((conn->ntlm.state != NTLMSTATE_NONE) ||
- (conn->proxyntlm.state != NTLMSTATE_NONE))
+ (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. */
- conn->data->state.authstage = 0;
+ data->state.authhost.done = FALSE;
+ data->state.authhost.picked =
+ data->state.authhost.want;
+
+ data->state.authproxy.done = FALSE;
+ data->state.authproxy.picked =
+ data->state.authhost.want;
+
+ data->state.authproblem = FALSE;
+ }
if(conn->curl_disconnect)
/* This is set if protocol-specific cleanups should be made */
@@ -1358,8 +1370,8 @@ CURLcode Curl_disconnect(struct connectdata *conn)
if(-1 != conn->connectindex) {
/* unlink ourselves! */
- infof(conn->data, "Closing connection #%d\n", conn->connectindex);
- conn->data->state.connects[conn->connectindex] = NULL;
+ infof(data, "Closing connection #%d\n", conn->connectindex);
+ data->state.connects[conn->connectindex] = NULL;
}
Curl_safefree(conn->proto.generic);
@@ -1488,7 +1500,7 @@ ConnectionExists(struct SessionHandle *data,
}
if((needle->protocol & PROT_FTP) ||
((needle->protocol & PROT_HTTP) &&
- (needle->data->state.authwant==CURLAUTH_NTLM))) {
+ (needle->data->state.authhost.want==CURLAUTH_NTLM))) {
/* This is FTP or HTTP+NTLM, verify that we're using the same name
and password as well */
if(!strequal(needle->user, check->user) ||