aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-04-20 19:37:54 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-04-23 22:36:01 +0200
commit710f14edba4491a4ac9222a7e3103b51fd30dbe0 (patch)
tree18b564248ec40eb30d030a8e246b3ecda3715ce6 /lib/url.c
parentcf9342e275b784f5a6006f833b33b40043f228d4 (diff)
handler: make 'protocol' always specified as a single bit
This makes the findprotocol() function work as intended so that libcurl can properly be restricted to not support HTTP while still supporting HTTPS - since the HTTPS handler previously set both the HTTP and HTTPS bits in the protocol field. This fixes --proto and --proto-redir for most SSL protocols. This is done by adding a few new convenience defines that groups HTTP and HTTPS, FTP and FTPS etc that should then be used when the code wants to check for both protocols at once. PROTO_FAMILY_[protocol] style. Bug: https://github.com/bagder/curl/pull/97 Reported-by: drizzt
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index b871bd634..409085f93 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2703,7 +2703,7 @@ static bool SocketIsDead(curl_socket_t sock)
static bool IsPipeliningPossible(const struct SessionHandle *handle,
const struct connectdata *conn)
{
- if((conn->handler->protocol & CURLPROTO_HTTP) &&
+ if((conn->handler->protocol & PROTO_FAMILY_HTTP) &&
Curl_multi_pipeline_enabled(handle->multi) &&
(handle->set.httpreq == HTTPREQ_GET ||
handle->set.httpreq == HTTPREQ_HEAD) &&
@@ -2927,7 +2927,7 @@ ConnectionExists(struct SessionHandle *data,
bool canPipeline = IsPipeliningPossible(data, needle);
bool wantNTLMhttp = ((data->state.authhost.want & CURLAUTH_NTLM) ||
(data->state.authhost.want & CURLAUTH_NTLM_WB)) &&
- (needle->handler->protocol & CURLPROTO_HTTP) ? TRUE : FALSE;
+ (needle->handler->protocol & PROTO_FAMILY_HTTP) ? TRUE : FALSE;
struct connectbundle *bundle;
*force_reuse = FALSE;
@@ -5330,7 +5330,7 @@ static CURLcode create_conn(struct SessionHandle *data,
#else
/* force this connection's protocol to become HTTP if not already
compatible - if it isn't tunneling through */
- if(!(conn->handler->protocol & CURLPROTO_HTTP) &&
+ if(!(conn->handler->protocol & PROTO_FAMILY_HTTP) &&
!conn->bits.tunnel_proxy)
conn->handler = &Curl_handler_http;