mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
use the new name and hostname even though an old connection is reused, since
we can re-use a proxy connection that actually has different host names on the same connection
This commit is contained in:
parent
ac0bad2433
commit
e9b763ff05
15
lib/url.c
15
lib/url.c
@ -1627,12 +1627,17 @@ static CURLcode Connect(struct UrlData *data,
|
|||||||
* just allocated before we can move along and use the previously
|
* just allocated before we can move along and use the previously
|
||||||
* existing one.
|
* existing one.
|
||||||
*/
|
*/
|
||||||
char *path = conn->path; /* setup the current path pointer properly */
|
struct connectdata *old_conn = conn;
|
||||||
if(conn->proxyhost)
|
char *path = old_conn->path; /* setup the current path pointer properly */
|
||||||
free(conn->proxyhost);
|
if(old_conn->proxyhost)
|
||||||
free(conn); /* we don't need this new one */
|
free(old_conn->proxyhost);
|
||||||
conn = conn_temp; /* use this connection from now on */
|
conn = conn_temp; /* use this connection from now on */
|
||||||
free(conn->path); /* free the previous path pointer */
|
free(conn->path); /* free the previous path pointer */
|
||||||
|
|
||||||
|
/* we need these pointers if we speak over a proxy */
|
||||||
|
conn->name = old_conn->name;
|
||||||
|
conn->hostname = old_conn->hostname;
|
||||||
|
|
||||||
conn->path = path; /* use this one */
|
conn->path = path; /* use this one */
|
||||||
conn->ppath = path; /* set this too */
|
conn->ppath = path; /* set this too */
|
||||||
|
|
||||||
@ -1640,6 +1645,8 @@ static CURLcode Connect(struct UrlData *data,
|
|||||||
conn->maxdownload = 0; /* might have been used previously! */
|
conn->maxdownload = 0; /* might have been used previously! */
|
||||||
conn->bits.reuse = TRUE; /* yes, we're re-using here */
|
conn->bits.reuse = TRUE; /* yes, we're re-using here */
|
||||||
|
|
||||||
|
free(old_conn); /* we don't need this anymore */
|
||||||
|
|
||||||
*in_connect = conn; /* return this instead! */
|
*in_connect = conn; /* return this instead! */
|
||||||
|
|
||||||
infof(data, "Re-using existing connection! (#%d)\n", conn->connectindex);
|
infof(data, "Re-using existing connection! (#%d)\n", conn->connectindex);
|
||||||
|
Loading…
Reference in New Issue
Block a user