Skip to content

Connection reuse not working for HTTP3 connections #14890

Description

@mackenzie-remote

I did this

When I use a version of curl that supports HTTP3, and uses the alt-svc cache file, domains that do have h3 enabled don't seem to do connection reuse, where-as if I connect to h2 the connection is reused.

Example curl.config file:

url = "https://www.youtube.com/feeds/videos.xml?channel_id=UCC8VtutLDSrreNEZj8CU01A"
output = /dev/null
next
url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC7_VGkwCoKfqh1eZEkzey3A"
output = /dev/null

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:

* Re-using existing connection with host www.youtube.com

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

* Connected to www.youtube.com () port 443

(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

Metadata

Metadata

Assignees

Labels

HTTP/3h3 or quic related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions