|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
Body-size limits, buffering thresholds, deadline, TLS, and HTTP protocol negotiation for an HTTP client or server. More...
#include <cpp/a11/net/http2.h>
Public Types | |
| enum class | ProtocolPreference { kAuto , kHttp2 , kHttp11 } |
| Client-side HTTP protocol preference / downgrade policy. More... | |
Public Member Functions | |
| absl::Status | Validate () const |
| Validate size relationships, deadline, TLS, and protocol settings. | |
Public Attributes | |
| size_t | max_request_body_size = 32 * 1024 * 1024 |
| Request hard limit. | |
| size_t | max_response_body_size = 32 * 1024 * 1024 |
| Response hard limit. | |
| size_t | max_buffered_request_bytes |
| Request backpressure bound. | |
| size_t | max_buffered_response_bytes |
| Response backpressure bound. | |
| absl::Time | deadline = absl::InfiniteFuture() |
| Connection-wide deadline. | |
| Http2TlsOptions | tls |
| TLS and certificate policy. | |
| bool | enable_h2 = true |
| Serve/accept HTTP/2 over TLS (ALPN "h2"). | |
| bool | enable_h2c = true |
| Serve/accept cleartext prior-knowledge HTTP/2. | |
| bool | enable_http1 = true |
| Serve/accept HTTP/1.1 (ALPN and/or cleartext). | |
| bool | enable_push = false |
| Client: accept HTTP/2 server pushes (SETTINGS_ENABLE_PUSH). | |
| ProtocolPreference | client_preference = ProtocolPreference::kAuto |
| Client protocol preference; also governs cleartext attempt order. | |
| bool | client_allow_downgrade = true |
| Whether a cleartext client may reconnect with the other protocol when its first attempt fails (ALPN makes TLS negotiation unambiguous already). | |
| std::function< bool(std::string_view method, std::string_view path, const HttpHeaders &headers)> | stream_request_body |
| Server: decides from a request's head whether its body arrives incrementally. | |
Body-size limits, buffering thresholds, deadline, TLS, and HTTP protocol negotiation for an HTTP client or server.
|
strong |
| absl::Status a11::net::Http2Options::Validate | ( | ) | const |
Validate size relationships, deadline, TLS, and protocol settings.
| bool a11::net::Http2Options::client_allow_downgrade = true |
Whether a cleartext client may reconnect with the other protocol when its first attempt fails (ALPN makes TLS negotiation unambiguous already).
| ProtocolPreference a11::net::Http2Options::client_preference = ProtocolPreference::kAuto |
Client protocol preference; also governs cleartext attempt order.
| absl::Time a11::net::Http2Options::deadline = absl::InfiniteFuture() |
Connection-wide deadline.
| bool a11::net::Http2Options::enable_h2 = true |
Serve/accept HTTP/2 over TLS (ALPN "h2").
| bool a11::net::Http2Options::enable_h2c = true |
Serve/accept cleartext prior-knowledge HTTP/2.
| bool a11::net::Http2Options::enable_http1 = true |
Serve/accept HTTP/1.1 (ALPN and/or cleartext).
| bool a11::net::Http2Options::enable_push = false |
Client: accept HTTP/2 server pushes (SETTINGS_ENABLE_PUSH).
Off by default, and advertised as off, so a peer cannot spend this side's streams and flow-control window on responses nobody asked for. A client that sets it must read Http2ResponseStream::NextPush() and either consume or Cancel() each pushed response, or those streams stay open.
| size_t a11::net::Http2Options::max_buffered_request_bytes |
Request backpressure bound.
| size_t a11::net::Http2Options::max_buffered_response_bytes |
Response backpressure bound.
| size_t a11::net::Http2Options::max_request_body_size = 32 * 1024 * 1024 |
Request hard limit.
| size_t a11::net::Http2Options::max_response_body_size = 32 * 1024 * 1024 |
Response hard limit.
| std::function<bool(std::string_view method, std::string_view path, const HttpHeaders& headers)> a11::net::Http2Options::stream_request_body |
Server: decides from a request's head whether its body arrives incrementally.
A request this accepts is dispatched to the handler as soon as its headers land, with HttpRequest::body_stream carrying the body as it arrives and HttpRequest::body left empty; every other request is buffered whole and dispatched once complete, which is what an unset predicate means. Reach for it when a request body is an open-ended stream of application messages rather than a document – the HTTP SSE transport's streaming outbound direction is exactly that. An extended CONNECT stream is delivered this way regardless.
Called on the connection's libuv thread, so keep it a cheap inspection of the head. max_buffered_request_bytes bounds what the stream holds while the handler is not reading, and max_request_body_size does not apply – a stream has no total length to compare against.
| Http2TlsOptions a11::net::Http2Options::tls |
TLS and certificate policy.