aboutsummaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-12-13 09:24:08 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-12-13 09:26:43 +0100
commit536f5f442e779b29ff2f28cd26a847058cdd6ed1 (patch)
tree9007278460e6f0a64a5c72eb4dd9b55bd8b24e54 /src/tool_operate.c
parent4bcc532de5b639ace6f96f0a30524a08861843b1 (diff)
curl: use 2TLS by default
Make this the default for the curl tool (if built with HTTP/2 powers enabled) unless a specific HTTP version is requested on the command line. This should allow more users to get HTTP/2 powers without having to change anything.
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index d5177d92b..e5506c6fa 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -956,9 +956,11 @@ static CURLcode operate_do(struct GlobalConfig *global,
/* new in libcurl 7.5 */
my_setopt(curl, CURLOPT_MAXREDIRS, config->maxredirs);
- /* new in libcurl 7.9.1 */
if(config->httpversion)
my_setopt_enum(curl, CURLOPT_HTTP_VERSION, config->httpversion);
+ else if(curlinfo->features & CURL_VERSION_HTTP2) {
+ my_setopt_enum(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
+ }
/* new in libcurl 7.10.6 (default is Basic) */
if(config->authtype)