|
KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
|
Server-side HTTP/2 API. More...
#include <stddef.h>#include <stdint.h>#include <sys/types.h>#include <keel/h2.h>#include <keel/request.h>#include <keel/response.h>#include <keel/body_reader.h>#include <keel/router.h>

Go to the source code of this file.
Data Structures | |
| struct | KlH2ServerCallbacks |
| struct | KlH2ServerSession |
| struct | KlH2ServerConfig |
| struct | KlH2ServerStream |
| struct | KlH2ServerConn |
Typedefs | |
| typedef struct KlH2ServerSession | KlH2ServerSession |
| typedef struct KlH2ServerCallbacks | KlH2ServerCallbacks |
| typedef struct KlH2ServerStream | KlH2ServerStream |
| typedef struct KlH2ServerConn | KlH2ServerConn |
| typedef struct KlConn | KlConn |
| typedef KlH2ServerSession *(* | KlH2ServerSessionFactory) (KlAllocator *alloc, KlH2ServerCallbacks *callbacks, void *user_data) |
| Factory for creating server-side HTTP/2 sessions. | |
| typedef struct KlH2ServerConfig | KlH2ServerConfig |
Functions | |
| int | kl_h2_server_upgrade (KlConn *c, KlRouter *router, KlH2ServerConfig *cfg, const char *leftover, size_t leftover_len) |
| Upgrade a connection to HTTP/2 (direct h2c). | |
| int | kl_h2_server_upgrade_from_h1 (KlConn *c, KlRouter *router, KlH2ServerConfig *cfg, const char *leftover, size_t leftover_len) |
| Upgrade a connection to HTTP/2 from an HTTP/1.1 Upgrade request. | |
| int | kl_h2_server_on_readable (KlConn *c) |
| Handle readable event on an HTTP/2 connection. | |
| int | kl_h2_server_on_writable (KlConn *c) |
| Handle writable event on an HTTP/2 connection. | |
| void | kl_h2_server_drain_shutdown (KlConn *c) |
| Initiate graceful GOAWAY drain on an HTTP/2 connection. | |
| void | kl_h2_server_cleanup (KlConn *c) |
| Clean up all HTTP/2 state for a connection. | |
Server-side HTTP/2 API.
Server-side HTTP/2 types and functions. Shared protocol constants (max streams, window size) live in h2.h.
| typedef struct KlH2ServerSession KlH2ServerSession |
| typedef struct KlH2ServerCallbacks KlH2ServerCallbacks |
| typedef struct KlH2ServerStream KlH2ServerStream |
| typedef struct KlH2ServerConn KlH2ServerConn |
| typedef KlH2ServerSession *(* KlH2ServerSessionFactory) (KlAllocator *alloc, KlH2ServerCallbacks *callbacks, void *user_data) |
Factory for creating server-side HTTP/2 sessions.
| typedef struct KlH2ServerConfig KlH2ServerConfig |
| int kl_h2_server_upgrade | ( | KlConn * | c, |
| KlRouter * | router, | ||
| KlH2ServerConfig * | cfg, | ||
| const char * | leftover, | ||
| size_t | leftover_len | ||
| ) |
Upgrade a connection to HTTP/2 (direct h2c).
| int kl_h2_server_upgrade_from_h1 | ( | KlConn * | c, |
| KlRouter * | router, | ||
| KlH2ServerConfig * | cfg, | ||
| const char * | leftover, | ||
| size_t | leftover_len | ||
| ) |
Upgrade a connection to HTTP/2 from an HTTP/1.1 Upgrade request.
| int kl_h2_server_on_readable | ( | KlConn * | c | ) |
Handle readable event on an HTTP/2 connection.
| int kl_h2_server_on_writable | ( | KlConn * | c | ) |
Handle writable event on an HTTP/2 connection.
| void kl_h2_server_drain_shutdown | ( | KlConn * | c | ) |
Initiate graceful GOAWAY drain on an HTTP/2 connection.
| void kl_h2_server_cleanup | ( | KlConn * | c | ) |
Clean up all HTTP/2 state for a connection.