From f2584627c8314b5954645ed4e05f48868928bd87 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Tue, 12 Nov 2013 19:01:04 +0000 Subject: 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. --- lib/url.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/url.c b/lib/url.c index 36bd46455..7536877ba 100644 --- a/lib/url.c +++ b/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, -- cgit v1.2.3