quic settings

This commit is contained in:
Jorijn van der Graaf 2026-08-25 19:17:22 +02:00
commit 675476dfea
5 changed files with 175 additions and 9 deletions

View file

@ -460,16 +460,18 @@ static HQUIC OpenClientConfiguration(const std::string& alpn, const QUICClientCr
QUIC_SETTINGS settings{};
settings.IsSet.IdleTimeoutMs = 1;
settings.IdleTimeoutMs = 120'000;
settings.IdleTimeoutMs = creds.settings.idleTimeoutMs;
settings.IsSet.HandshakeIdleTimeoutMs = 1;
settings.HandshakeIdleTimeoutMs = creds.settings.handshakeIdleTimeoutMs;
// Keep the connection alive across long idle gaps. msquic sends PING frames
// on its own timer thread (independent of the app), so a request/response
// connection survives even while the app is blocked for a long time between
// requests (e.g. a client waiting on slow LLM inference). Interval < idle
// timeout so the peer's idle timer never expires.
settings.IsSet.KeepAliveIntervalMs = 1;
settings.KeepAliveIntervalMs = 10'000;
settings.KeepAliveIntervalMs = creds.settings.keepAliveIntervalMs;
settings.IsSet.DatagramReceiveEnabled = 1;
settings.DatagramReceiveEnabled = 1;
settings.DatagramReceiveEnabled = creds.settings.datagramReceiveEnabled ? 1 : 0;
// Allow the server to open unidi/bidi streams to us. msquic defaults
// both peer-stream-count limits to 0; with that, the server's HTTP/3
// control stream + QPACK encoder/decoder streams can't be created and
@ -477,9 +479,9 @@ static HQUIC OpenClientConfiguration(const std::string& alpn, const QUICClientCr
// currently use server push (h3 pushes ride on unidi 0x01 streams) but
// the bidi cap is harmless to grant.
settings.IsSet.PeerUnidiStreamCount = 1;
settings.PeerUnidiStreamCount = 16;
settings.PeerUnidiStreamCount = creds.settings.peerUnidiStreamCount;
settings.IsSet.PeerBidiStreamCount = 1;
settings.PeerBidiStreamCount = 16;
settings.PeerBidiStreamCount = creds.settings.peerBidiStreamCount;
HQUIC cfg = nullptr;
QUIC_STATUS s = Runtime().api->ConfigurationOpen(Runtime().registration, &alpnBuffer, 1,