aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-09-05 14:35:57 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-05 14:36:19 +0200
commit25fd1057c9c86e32d43fce147e80f47f6b385c84 (patch)
treee6e4aafa0bc6981f961cc4421cb60ab7a908264f /lib
parentd7c4213bd0cfd16054fa75a887d3e1a9a796cb53 (diff)
url: default to CURL_HTTP_VERSION_2TLS if built h2-enabled
Closes #2709
Diffstat (limited to 'lib')
-rw-r--r--lib/setopt.c2
-rw-r--r--lib/url.c18
2 files changed, 11 insertions, 9 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index 5c5f4b381..f2fadc786 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -841,6 +841,8 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
#else
if(arg > CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE)
return CURLE_UNSUPPORTED_PROTOCOL;
+ if(arg == CURL_HTTP_VERSION_NONE)
+ arg = CURL_HTTP_VERSION_2TLS;
#endif
data->set.httpversion = arg;
break;
diff --git a/lib/url.c b/lib/url.c
index f15900889..7ffad19b7 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -516,25 +516,27 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
set->wildcard_enabled = FALSE;
set->chunk_bgn = ZERO_NULL;
set->chunk_end = ZERO_NULL;
-
- /* tcp keepalives are disabled by default, but provide reasonable values for
- * the interval and idle times.
- */
set->tcp_keepalive = FALSE;
set->tcp_keepintvl = 60;
set->tcp_keepidle = 60;
set->tcp_fastopen = FALSE;
set->tcp_nodelay = TRUE;
-
set->ssl_enable_npn = TRUE;
set->ssl_enable_alpn = TRUE;
-
set->expect_100_timeout = 1000L; /* Wait for a second by default. */
set->sep_headers = TRUE; /* separated header lists by default */
set->buffer_size = READBUFFER_SIZE;
set->upload_buffer_size = UPLOAD_BUFSIZE;
set->happy_eyeballs_timeout = CURL_HET_DEFAULT;
-
+ set->fnmatch = ZERO_NULL;
+ set->maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */
+ set->httpversion =
+#ifdef USE_NGHTTP2
+ CURL_HTTP_VERSION_2TLS
+#else
+ CURL_HTTP_VERSION_1_1
+#endif
+ ;
Curl_http2_init_userset(set);
return result;
}
@@ -594,8 +596,6 @@ CURLcode Curl_open(struct Curl_easy **curl)
data->progress.flags |= PGRS_HIDE;
data->state.current_speed = -1; /* init to negative == impossible */
- data->set.fnmatch = ZERO_NULL;
- data->set.maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */
Curl_http2_init_state(&data->state);
}