mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:53:46 +03:00
conn->user and conn->passwd will now always be set to point to something.
If not user or password is set, they will point to a "" string.
This commit is contained in:
parent
d7c09efeb1
commit
d1c08e1d85
2 changed files with 6 additions and 9 deletions
|
|
@ -125,9 +125,7 @@ static CURLcode Curl_output_basic(struct connectdata *conn)
|
|||
char *authorization;
|
||||
struct SessionHandle *data=conn->data;
|
||||
|
||||
sprintf(data->state.buffer, "%s:%s",
|
||||
conn->user?conn->user:"",
|
||||
conn->passwd?conn->passwd:"");
|
||||
sprintf(data->state.buffer, "%s:%s", conn->user, conn->passwd);
|
||||
if(Curl_base64_encode(data->state.buffer, strlen(data->state.buffer),
|
||||
&authorization) >= 0) {
|
||||
if(conn->allocptr.userpwd)
|
||||
|
|
@ -147,8 +145,7 @@ static CURLcode Curl_output_basic_proxy(struct connectdata *conn)
|
|||
struct SessionHandle *data=conn->data;
|
||||
|
||||
sprintf(data->state.buffer, "%s:%s",
|
||||
conn->proxyuser?conn->proxyuser:"",
|
||||
conn->proxypasswd?conn->proxypasswd:"");
|
||||
conn->proxyuser, conn->proxypasswd);
|
||||
if(Curl_base64_encode(data->state.buffer, strlen(data->state.buffer),
|
||||
&authorization) >= 0) {
|
||||
Curl_safefree(conn->allocptr.proxyuserpwd);
|
||||
|
|
@ -291,7 +288,7 @@ CURLcode http_auth_headers(struct connectdata *conn,
|
|||
}
|
||||
if(auth)
|
||||
infof(data, "Server auth using %s with user '%s'\n",
|
||||
auth, conn->user?conn->user:"");
|
||||
auth, conn->user);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue