[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 90/220: http3: fix the HTTP/3 in the request, make
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 90/220: http3: fix the HTTP/3 in the request, make alt-svc set right versions |
Date: |
Thu, 12 Sep 2019 17:27:30 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit a93b43cde82d7a48014990d6a31dc917c1b5f93c
Author: Daniel Stenberg <address@hidden>
AuthorDate: Wed Aug 7 19:30:53 2019 +0200
http3: fix the HTTP/3 in the request, make alt-svc set right versions
Closes #4200
---
lib/http.c | 79 ++++++++++++++++++++++++++++++++++----------------------------
lib/url.c | 6 ++---
2 files changed, 46 insertions(+), 39 deletions(-)
diff --git a/lib/http.c b/lib/http.c
index 73d52aee5..12e260bff 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1666,6 +1666,12 @@ static bool use_http_1_1plus(const struct Curl_easy
*data,
static const char *get_http_string(const struct Curl_easy *data,
const struct connectdata *conn)
{
+#ifdef ENABLE_QUIC
+ if((data->set.httpversion == CURL_HTTP_VERSION_3) ||
+ (conn->httpversion == 30))
+ return "3";
+#endif
+
#ifdef USE_NGHTTP2
if(conn->proto.httpc.h2)
return "2";
@@ -2005,49 +2011,50 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
the rest of the request in the PERFORM phase. */
*done = TRUE;
- if(conn->httpversion < 20) { /* unless the connection is re-used and already
- http2 */
- switch(conn->negnpn) {
- case CURL_HTTP_VERSION_2:
- conn->httpversion = 20; /* we know we're on HTTP/2 now */
-
- result = Curl_http2_switched(conn, NULL, 0);
- if(result)
- return result;
- break;
- case CURL_HTTP_VERSION_1_1:
- /* continue with HTTP/1.1 when explicitly requested */
- break;
- default:
- /* Check if user wants to use HTTP/2 with clear TCP*/
-#ifdef USE_NGHTTP2
- if(conn->data->set.httpversion ==
- CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE) {
- if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) {
- /* We don't support HTTP/2 proxies yet. Also it's debatable whether
- or not this setting should apply to HTTP/2 proxies. */
- infof(data, "Ignoring HTTP/2 prior knowledge due to proxy\n");
- break;
- }
-
- DEBUGF(infof(data, "HTTP/2 over clean TCP\n"));
- conn->httpversion = 20;
+ if(conn->transport != TRNSPRT_QUIC) {
+ if(conn->httpversion < 20) { /* unless the connection is re-used and
+ already http2 */
+ switch(conn->negnpn) {
+ case CURL_HTTP_VERSION_2:
+ conn->httpversion = 20; /* we know we're on HTTP/2 now */
result = Curl_http2_switched(conn, NULL, 0);
if(result)
return result;
- }
+ break;
+ case CURL_HTTP_VERSION_1_1:
+ /* continue with HTTP/1.1 when explicitly requested */
+ break;
+ default:
+ /* Check if user wants to use HTTP/2 with clear TCP*/
+#ifdef USE_NGHTTP2
+ if(conn->data->set.httpversion ==
+ CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE) {
+ if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) {
+ /* We don't support HTTP/2 proxies yet. Also it's debatable
+ whether or not this setting should apply to HTTP/2 proxies. */
+ infof(data, "Ignoring HTTP/2 prior knowledge due to proxy\n");
+ break;
+ }
+
+ DEBUGF(infof(data, "HTTP/2 over clean TCP\n"));
+ conn->httpversion = 20;
+
+ result = Curl_http2_switched(conn, NULL, 0);
+ if(result)
+ return result;
+ }
#endif
- break;
+ break;
+ }
+ }
+ else {
+ /* prepare for a http2 request */
+ result = Curl_http2_setup(conn);
+ if(result)
+ return result;
}
}
- else {
- /* prepare for a http2 request */
- result = Curl_http2_setup(conn);
- if(result)
- return result;
- }
-
http = data->req.protop;
DEBUGASSERT(http);
diff --git a/lib/url.c b/lib/url.c
index d31f83065..0b681803d 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3195,14 +3195,14 @@ static CURLcode parse_connect_to_slist(struct Curl_easy
*data,
/* protocol version switch */
switch(nalpnid) {
case ALPN_h1:
- conn->httpversion = CURL_HTTP_VERSION_1_1;
+ conn->httpversion = 11;
break;
case ALPN_h2:
- conn->httpversion = CURL_HTTP_VERSION_2TLS;
+ conn->httpversion = 20;
break;
case ALPN_h3:
conn->transport = TRNSPRT_QUIC;
- conn->httpversion = CURL_HTTP_VERSION_3;
+ conn->httpversion = 30;
break;
default: /* shouldn't be possible */
break;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 113/220: docs/HTTP3: simplify quiche build instruction, (continued)
- [GNUnet-SVN] [gnurl] 113/220: docs/HTTP3: simplify quiche build instruction, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 116/220: curl_version_info.3: mentioned ALTSVC and HTTP3, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 121/220: vauth: Use CURLE_AUTH_ERROR for auth function errors, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 125/220: quiche: happy eyeballs, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 119/220: examples: add http3.c, altsvc.c and http3-present.c, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 127/220: multi: getsock improvements for QUIC connecting, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 86/220: docs/EXPERIMENTAL: explain what it means and what's experimental now, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 73/220: tests: Fix the line endings for the SASL alt-auth tests, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 84/220: curl: use CURLINFO_PROTOCOL to check for HTTP(s), gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 72/220: examples: Added SASL PLAIN authorisation identity (authzid) examples, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 90/220: http3: fix the HTTP/3 in the request, make alt-svc set right versions,
gnunet <=
- [GNUnet-SVN] [gnurl] 88/220: CURLOPT_HTTP_VERSION: seting this to 3 forces HTTP/3 use directly, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 104/220: nghttp3: required when ngtcp2 is used for QUIC, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 106/220: ngtcp2: send HTTP/3 request with nghttp3, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 107/220: CURLOPT_READFUNCTION.3: provide inline example, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 111/220: ngtcp2: initial h3 request work, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 128/220: ngtcp2: don't reinitialize SSL on Retry, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 124/220: ngtcp2: do QUIC connections happy-eyeballs friendly, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 135/220: tests: Replace outdated test case numbering documentation, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 133/220: configure: use -lquiche to link to quiche, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 144/220: quiche: register debug callback once and earlier, gnunet, 2019/09/12