mirror of https://github.com/moparisthebest/curl
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.
This commit is contained in:
parent
097938e6c8
commit
7d2e872828
15
lib/url.c
15
lib/url.c
|
@ -1981,6 +1981,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
||||||
char user[MAX_CURL_USER_LENGTH];
|
char user[MAX_CURL_USER_LENGTH];
|
||||||
char passwd[MAX_CURL_PASSWORD_LENGTH];
|
char passwd[MAX_CURL_PASSWORD_LENGTH];
|
||||||
int rc;
|
int rc;
|
||||||
|
bool reuse;
|
||||||
|
|
||||||
#ifdef HAVE_SIGACTION
|
#ifdef HAVE_SIGACTION
|
||||||
struct sigaction keep_sigact; /* store the old struct here */
|
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))
|
if(!Curl_clone_ssl_config(&data->set.ssl, &conn->ssl_config))
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
/* reuse_fresh is set TRUE if we are told to use a fresh connection
|
/* reuse_fresh is TRUE if we are told to use a new connection by force, but
|
||||||
by force */
|
we only acknowledge this option if this is not a re-used connection
|
||||||
if(!data->set.reuse_fresh &&
|
already (which happens due to follow-location or during a HTTP
|
||||||
ConnectionExists(data, conn, &conn_temp)) {
|
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
|
* 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
|
* in the conn_temp variable and thus we need to cleanup the one we
|
||||||
|
|
Loading…
Reference in New Issue