diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-12-14 21:22:51 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-12-14 21:22:51 +0000 |
commit | 0d0d5e7ee3b8575118d8d268802623f2a9a49ee5 (patch) | |
tree | 716e4e63a171e2271ed3228319288aeb3d6be976 /lib | |
parent | 4f567d0f815a7214130ef968b34e5560bf2f49c1 (diff) |
Harshal Pradhan fixed changing username/password on a persitent HTTP
connection.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -3131,7 +3131,26 @@ static CURLcode CreateConnection(struct SessionHandle *data, /* get the user+password information from the old_conn struct since it may * be new for this request even when we re-use an existing connection */ conn->bits.user_passwd = old_conn->bits.user_passwd; + if (conn->bits.user_passwd) { + /* use the new user namd and password though */ + Curl_safefree(conn->user); + Curl_safefree(conn->passwd); + conn->user = old_conn->user; + conn->passwd = old_conn->passwd; + old_conn->user = NULL; + old_conn->passwd = NULL; + } + conn->bits.proxy_user_passwd = old_conn->bits.proxy_user_passwd; + if (conn->bits.proxy_user_passwd) { + /* use the new proxy user name and proxy password though */ + Curl_safefree(conn->proxyuser); + Curl_safefree(conn->proxypasswd); + conn->proxyuser = old_conn->proxyuser; + conn->proxypasswd = old_conn->proxypasswd; + old_conn->proxyuser = NULL; + old_conn->proxypasswd = NULL; + } /* host can change, when doing keepalive with a proxy ! */ if (conn->bits.httpproxy) { |