aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-11-12 19:01:04 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-11-12 19:08:55 +0000
commitf2584627c8314b5954645ed4e05f48868928bd87 (patch)
tree23d3eb15bab917bee8ade395c83d08a44f90c32c /lib/url.c
parent6901861fc97f0b3cb9ee8590c449ab6aa2fe0500 (diff)
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.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c14
1 files changed, 13 insertions, 1 deletions
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,