|
cwist
Modern C web framework with libttak runtime
|
#include <http2.h>
Public Attributes | |
| void *(* | on_conn_open )(void *user_ctx) |
| void(* | on_conn_close )(void *conn_ctx) |
| void *(* | on_headers )(void *conn_ctx, cwist_http_request *req, cwist_h2_stream *stream) |
| int(* | on_data )(void *conn_ctx, void *stream_ctx, const unsigned char *data, size_t len, int end_stream) |
| void(* | on_cancel )(void *conn_ctx, void *stream_ctx) |
| int(* | on_poll )(void *conn_ctx, void *stream_ctx) |
| uint64_t(* | next_deadline_ms )(void *conn_ctx) |
| void(* | on_close )(void *conn_ctx, void *stream_ctx) |
Optional per-connection hooks that let a higher layer (gRPC) take over individual streams: inbound DATA is delivered incrementally instead of being buffered, and the stream emits its own response frames.
Nearest deadline (monotonic ms) across taken streams; 0 = none. Bounds the dispatcher's socket wait so deadlines fire on time.
Definition at line 56 of file http2.h.
Referenced by cwist_http2_serve_connection_ex().
| void(* cwist_http2_stream_hooks::on_cancel) (void *conn_ctx, void *stream_ctx) |
Peer sent RST_STREAM (cancellation).
Definition at line 50 of file http2.h.
Referenced by cwist_http2_serve_connection_ex().
| void(* cwist_http2_stream_hooks::on_close) (void *conn_ctx, void *stream_ctx) |
Called once per connection; the result backs every other callback. May be NULL, in which case user_ctx is used as the hook context.
Definition at line 39 of file http2.h.
Referenced by cwist_http2_serve_connection_ex().
| int(* cwist_http2_stream_hooks::on_data) (void *conn_ctx, void *stream_ctx, const unsigned char *data, size_t len, int end_stream) |
Feed an inbound DATA payload; end_stream marks the client's final frame. Return non-zero to tear the stream down.
Definition at line 47 of file http2.h.
Referenced by cwist_http2_serve_connection_ex().
| void *(* cwist_http2_stream_hooks::on_headers) (void *conn_ctx, cwist_http_request *req, cwist_h2_stream *stream) |
| int(* cwist_http2_stream_hooks::on_poll) (void *conn_ctx, void *stream_ctx) |
Called on every dispatcher iteration; enforce deadlines here. Return non-zero when the stream is finished and may be torn down.
Definition at line 53 of file http2.h.
Referenced by cwist_http2_serve_connection_ex().