mirror of
https://github.com/curl/curl.git
synced 2026-08-26 01:23:32 +03:00
Harshal Pradhan fixed changing username/password on a persitent HTTP
connection.
This commit is contained in:
parent
4f567d0f81
commit
0d0d5e7ee3
7 changed files with 130 additions and 3 deletions
19
lib/url.c
19
lib/url.c
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue