aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-01 09:43:42 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-01 09:43:42 +0000
commit7d2e8728280f797bced37434d54e85ba95f02505 (patch)
treec0c2a43995c314251b200003baa721546b42fab1 /lib/url.c
parent097938e6c8c5b1b9412446a3120e00881fef7de7 (diff)
Only consider the fresh-connection option on the first connection made, not
on followed redirections etc. This should fix the bug #905365, which caused NTLM to fail with the option set.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/url.c b/lib/url.c
index e9dc7a02b..8755da82e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1981,6 +1981,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
char user[MAX_CURL_USER_LENGTH];
char passwd[MAX_CURL_PASSWORD_LENGTH];
int rc;
+ bool reuse;
#ifdef HAVE_SIGACTION
struct sigaction keep_sigact; /* store the old struct here */
@@ -2870,10 +2871,16 @@ static CURLcode CreateConnection(struct SessionHandle *data,
if(!Curl_clone_ssl_config(&data->set.ssl, &conn->ssl_config))
return CURLE_OUT_OF_MEMORY;
- /* reuse_fresh is set TRUE if we are told to use a fresh connection
- by force */
- if(!data->set.reuse_fresh &&
- ConnectionExists(data, conn, &conn_temp)) {
+ /* reuse_fresh is TRUE if we are told to use a new connection by force, but
+ we only acknowledge this option if this is not a re-used connection
+ already (which happens due to follow-location or during a HTTP
+ authentication phase). */
+ if(data->set.reuse_fresh && !conn->bits.reuse)
+ reuse = FALSE;
+ else
+ reuse = ConnectionExists(data, conn, &conn_temp);
+
+ if(reuse) {
/*
* We already have a connection for this, we got the former connection
* in the conn_temp variable and thus we need to cleanup the one we