[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 47/220: url: make use of new HTTP version if alt-sv
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 47/220: url: make use of new HTTP version if alt-svc has one |
Date: |
Thu, 12 Sep 2019 17:26:47 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit cc28a502bc3555fc9ebbcbbda6d0cbe561516541
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Aug 2 14:28:54 2019 +0200
url: make use of new HTTP version if alt-svc has one
---
lib/url.c | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/lib/url.c b/lib/url.c
index 54373027b..13d015753 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3160,11 +3160,23 @@ static CURLcode parse_connect_to_slist(struct Curl_easy
*data,
const char *nhost;
int nport;
enum alpnid nalpnid;
+ enum alpnid salpnid;
bool hit;
host = conn->host.rawalloc;
+#ifdef USE_NGHTTP2
+ /* with h2 support, check that first */
+ salpnid = ALPN_h2;
hit = Curl_altsvc_lookup(data->asi,
- ALPN_h1, host, conn->remote_port, /* from */
+ salpnid, host, conn->remote_port, /* from */
&nalpnid, &nhost, &nport /* to */);
+ if(!hit)
+#endif
+ {
+ salpnid = ALPN_h1;
+ hit = Curl_altsvc_lookup(data->asi,
+ salpnid, host, conn->remote_port, /* from */
+ &nalpnid, &nhost, &nport /* to */);
+ }
if(hit) {
char *hostd = strdup((char *)nhost);
if(!hostd)
@@ -3175,8 +3187,25 @@ static CURLcode parse_connect_to_slist(struct Curl_easy
*data,
conn->conn_to_port = nport;
conn->bits.conn_to_port = TRUE;
infof(data, "Alt-svc connecting from [%s]%s:%d to [%s]%s:%d\n",
- Curl_alpnid2str(ALPN_h1), host, conn->remote_port,
+ Curl_alpnid2str(salpnid), host, conn->remote_port,
Curl_alpnid2str(nalpnid), hostd, nport);
+ if(salpnid != nalpnid) {
+ /* protocol version switch */
+ switch(nalpnid) {
+ case ALPN_h1:
+ conn->httpversion = CURL_HTTP_VERSION_1_1;
+ break;
+ case ALPN_h2:
+ conn->httpversion = CURL_HTTP_VERSION_2TLS;
+ break;
+ case ALPN_h3:
+ conn->transport = TRNSPRT_QUIC;
+ conn->httpversion = CURL_HTTP_VERSION_LAST; /* for the moment */
+ break;
+ default: /* shouldn't be possible */
+ break;
+ }
+ }
}
}
#endif
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 29/220: curl: remove outdated comment, (continued)
- [GNUnet-SVN] [gnurl] 29/220: curl: remove outdated comment, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 27/220: readwrite_data: repair setting the TIMER_STARTTRANSFER stamp, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 39/220: mailmap: added 4 more names, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 41/220: mailmap: added Kyohei Kadota, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 36/220: appveyor: pass on -k to make, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 30/220: curl.h: fix outdated comment, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 42/220: quiche: add failf() calls for two error cases, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 34/220: ROADMAP: parallel transfers are merged now, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 35/220: timediff: make it 64 bit (if possible) even with 32 bit time_t, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 50/220: md4: Move the GNU TLS gcrypt MD4 implementation out of the NTLM code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 47/220: url: make use of new HTTP version if alt-svc has one,
gnunet <=
- [GNUnet-SVN] [gnurl] 48/220: OS400: Add CURLOPT_H3 symbols, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 55/220: md4: No need for the NTLM code to call Curl_md4it() for each TLS library, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 60/220: lib/Makefile.am: make checksrc run in vquic too, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 64/220: quiche: show the actual version number, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 49/220: md4: Move the GNU TLS Nettle MD4 implementation out of the NTLM code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 57/220: md4: Use our own MD4 implementation when no crypto libraries are available, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 62/220: http09: disable HTTP/0.9 by default in both tool and library, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 68/220: mesalink: implement client authentication, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 80/220: curl.h: add CURL_HTTP_VERSION_3 to the version enum, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 79/220: quiche: make use of the connection timeout API properly, gnunet, 2019/09/12