diff options
author | Steve Holme <steve_holme@hotmail.com> | 2016-04-08 18:41:41 +0100 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2016-04-08 18:41:41 +0100 |
commit | 39d68b47e19c9dc42d578a923cb842f061eac165 (patch) | |
tree | 0491ae33702d74cf357c4063b77c36940165944b /lib | |
parent | 0e6ff33bd53a036418583234e3e512ebb2150ad7 (diff) |
http_negotiate: Calculate service name and proxy service name locally
Calculate the service name and proxy service names locally, rather than
in url.c which will allow for us to support overriding the service name
for other protocols such as FTP, IMAP, POP3 and SMTP.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http_negotiate.c | 6 | ||||
-rw-r--r-- | lib/url.c | 12 | ||||
-rw-r--r-- | lib/url.h | 3 |
3 files changed, 4 insertions, 17 deletions
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index 9e1a83ccc..92113eb07 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -53,14 +53,16 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy, if(proxy) { userp = conn->proxyuser; passwdp = conn->proxypasswd; - service = data->set.str[STRING_PROXY_SERVICE_NAME]; + service = data->set.str[STRING_PROXY_SERVICE_NAME] ? + data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP"; host = conn->proxy.name; neg_ctx = &data->state.proxyneg; } else { userp = conn->user; passwdp = conn->passwd; - service = data->set.str[STRING_SERVICE_NAME]; + service = data->set.str[STRING_SERVICE_NAME] ? + data->set.str[STRING_SERVICE_NAME] : "HTTP"; host = conn->host.name; neg_ctx = &data->state.negotiate; } @@ -576,18 +576,6 @@ CURLcode Curl_init_userdefined(struct UserDefined *set) CURL_DEFAULT_SOCKS5_GSSAPI_SERVICE); if(result) return result; - - /* set default negotiate proxy service name */ - result = setstropt(&set->str[STRING_PROXY_SERVICE_NAME], - CURL_DEFAULT_PROXY_SERVICE_NAME); - if(result) - return result; - - /* set default negotiate service name */ - result = setstropt(&set->str[STRING_SERVICE_NAME], - CURL_DEFAULT_SERVICE_NAME); - if(result) - return result; #endif /* This is our preferred CA cert bundle/path since install time */ @@ -69,9 +69,6 @@ void Curl_close_connections(struct SessionHandle *data); #define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */ #define CURL_DEFAULT_SOCKS5_GSSAPI_SERVICE "rcmd" /* default socks5 gssapi service */ -#define CURL_DEFAULT_PROXY_SERVICE_NAME "HTTP" /* default negotiate proxy - service */ -#define CURL_DEFAULT_SERVICE_NAME "HTTP" /* default negotiate service */ CURLcode Curl_connected_proxy(struct connectdata *conn, int sockindex); |