-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Connection reuse not working for HTTP3 connections #14890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@mackenzie-remote can you provide us a curl trace of such a situation? Please invoke curl with |
OK that's annoying. I can't replicate the issue on Darwin, but I can replicate it on Linux. Binaries built by this project https://github.com/stunnel/static-curl at curl version: OS version: Logs attached as requested with File 1 is first run with no alt-svc.txt
|
Thanks. I have reproduced in a local test case that the first url's connection is indeed not reused, but should have been. Investigating... |
- When searching for existing connections, interpret the default CURL_HTTP_VERSION_2TLS as "anything goes". This will allow us to reuse HTTP/3 connections better - add 'http/1.1' as allowed protocol identifier in Alt-Svc files - add test_02_0[345] for testing protocol selection on provided alt-svc files refs curl#14890
Found the problem. HTTP/3 connections were not reused when the transfer had no specific requirements. This led to your second request to open a new connection. Should be fixed in #14966. |
Thanks, am trying to build that locally to test the fixed branch.. Will report back. |
That fixed the issue, thank you again @icing! Happy log expert from the second run showing it re-using the existing HTTP/3 connection:
|
- When searching for existing connections, interpret the default CURL_HTTP_VERSION_2TLS as "anything goes". This will allow us to reuse HTTP/3 connections better - add 'http/1.1' as allowed protocol identifier in Alt-Svc files - add test_02_0[345] for testing protocol selection on provided alt-svc files Fixes #14890 Reported-by: MacKenzie Closes #14966
- When searching for existing connections, interpret the default CURL_HTTP_VERSION_2TLS as "anything goes". This will allow us to reuse HTTP/3 connections better - add 'http/1.1' as allowed protocol identifier in Alt-Svc files - add test_02_0[345] for testing protocol selection on provided alt-svc files Fixes curl#14890 Reported-by: MacKenzie Closes curl#14966
I did this
When I use a version of curl that supports HTTP3, and uses the
alt-svc
cache file, domains that do haveh3
enabled don't seem to do connection reuse, where-as if I connect toh2
the connection is reused.Example
curl.config
file:curl --alt-svc alt-svc.txt -v -K curl.config
The first time (with verbose) and an empty alt-svc, I can see this log message between the first and second transfer:
When running curl a second time with a populated alt-svc cache it connects using hhttp3 and it does not say 'Re-using existing connection' but
(and I verified that it wasn't just a logging issue - when I ran tcpdump I could see that it was opening a new udp connection with a different source port).
I expected the following
For subsequent connections are reused to the same host when using http3.
curl/libcurl version
curl 8.10.0 (aarch64-apple-darwin) libcurl/8.10.0 OpenSSL/3.3.2 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 c-ares/1.33.1 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.63.0 nghttp3/1.5.0
Release-Date: 2024-09-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Largefile libz NTLM PSL SSL threadsafe TLS-SRP TrackMemory UnixSockets zstd
operating system
Darwin xx 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:21 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8103 arm64
The text was updated successfully, but these errors were encountered: