mirror of
https://github.com/curl/curl.git
synced 2026-08-03 11:40:28 +03:00
curl_easy_setopt: Added the ability to set the login options separately
Rather than set the authentication options as part of the login details specified in the URL, or via the older CURLOPT_USERPWD option, added a new libcurl option to allow the login options to be set separately.
This commit is contained in:
parent
6901861fc9
commit
f2584627c8
8 changed files with 37 additions and 7 deletions
14
lib/url.c
14
lib/url.c
|
|
@ -1560,6 +1560,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||
&data->set.str[STRING_PASSWORD],
|
||||
&data->set.str[STRING_OPTIONS]);
|
||||
break;
|
||||
|
||||
case CURLOPT_USERNAME:
|
||||
/*
|
||||
* authentication user name to use in the operation
|
||||
|
|
@ -1567,6 +1568,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||
result = setstropt(&data->set.str[STRING_USERNAME],
|
||||
va_arg(param, char *));
|
||||
break;
|
||||
|
||||
case CURLOPT_PASSWORD:
|
||||
/*
|
||||
* authentication password to use in the operation
|
||||
|
|
@ -1574,6 +1576,15 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||
result = setstropt(&data->set.str[STRING_PASSWORD],
|
||||
va_arg(param, char *));
|
||||
break;
|
||||
|
||||
case CURLOPT_OPTIONS:
|
||||
/*
|
||||
* authentication options to use in the operation
|
||||
*/
|
||||
result = setstropt(&data->set.str[STRING_OPTIONS],
|
||||
va_arg(param, char *));
|
||||
break;
|
||||
|
||||
case CURLOPT_XOAUTH2_BEARER:
|
||||
/*
|
||||
* XOAUTH2 bearer token to use in the operation
|
||||
|
|
@ -1581,6 +1592,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||
result = setstropt(&data->set.str[STRING_BEARER],
|
||||
va_arg(param, char *));
|
||||
break;
|
||||
|
||||
case CURLOPT_POSTQUOTE:
|
||||
/*
|
||||
* List of RAW FTP commands to use after a transfer
|
||||
|
|
@ -4824,7 +4836,7 @@ static CURLcode override_login(struct SessionHandle *data,
|
|||
}
|
||||
|
||||
/*
|
||||
* Set password so it's available in the connection.
|
||||
* Set the login details so they're available in the connection
|
||||
*/
|
||||
static CURLcode set_login(struct connectdata *conn,
|
||||
const char *user, const char *passwd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue