Skip to main content

CONNECTION_CAP_REFUSAL

Constant CONNECTION_CAP_REFUSAL 

Source
pub const CONNECTION_CAP_REFUSAL: &[u8] = b"HTTP/1.1 503 Service Unavailable\r\n\
    Content-Length: 0\r\nRetry-After: 5\r\nConnection: close\r\n\r\n";
Expand description

What a cleartext (h2c) peer over [MAX_CONNECTIONS] is told before the socket closes.

HTTP/1.1 503 Service Unavailable with a Retry-After, deliberately in the older protocol, for the reason src/server/etcd/mod.rs gives: the refused peer has not sent the HTTP/2 preface, so nothing has been negotiated, and an HTTP/2 GOAWAY would have to follow a SETTINGS frame this server is declining to exchange. Every HTTP client can read a 503.

Over TLS the refusal is a plain close instead (see spawn_with_push_support): plaintext bytes written to a peer that is about to send a ClientHello are a malformed TLS record, not a refusal — the same reasoning that makes doh and dot close silently.