11#ifndef KEEL_H2_CLIENT_H
12#define KEEL_H2_CLIENT_H
24#define KL_H2_CLIENT_DEFAULT_TIMEOUT_MS 30000
26#define KL_H2_CLIENT_RECV_BUF_SIZE 16384
60 const char *data,
size_t len);
72 const char *method,
const char *path,
73 const char *authority,
75 const char *body,
size_t body_len);
138 const char *body,
size_t body_len,
Shared HTTP/2 protocol constants.
void(* KlH2ClientErrorFn)(KlH2ClientConn *c, const char *msg, void *user_data)
Connection-level error callback.
Definition h2_client.h:105
int32_t kl_h2_client_request(KlH2ClientConn *c, const char *method, const char *path, const KlH2ClientHeader *hdrs, int n, const char *body, size_t body_len, KlH2ClientResponseFn on_resp, void *ud)
Submit an HTTP/2 request.
void kl_h2_client_response_free(KlH2ClientResponse *resp, KlAllocator *alloc)
Free a response's headers and body (allocator-owned).
KlH2ClientConn * kl_h2_client_connect(KlEventCtx *ev, KlAllocator *alloc, const KlH2ClientConfig *cfg, const char *url, KlH2ClientErrorFn on_error, void *user_data)
Connect to an HTTP/2 server.
void(* KlH2ClientResponseFn)(KlH2ClientConn *c, int32_t stream_id, const KlH2ClientResponse *resp, void *user_data)
Per-stream response completion callback.
Definition h2_client.h:101
void kl_h2_client_free(KlH2ClientConn *c)
Free all HTTP/2 client resources.
struct KlH2ClientStream KlH2ClientStream
Definition h2_client.h:31
KlH2ClientSession *(* KlH2ClientSessionFactory)(KlAllocator *alloc)
Factory for creating client-side HTTP/2 sessions.
Definition h2_client.h:87
struct KlH2ClientConn KlH2ClientConn
Definition h2_client.h:30
void kl_h2_client_close(KlH2ClientConn *c)
Close the HTTP/2 client connection.
Bring-your-own allocator vtable.
Definition allocator.h:12
Composable event loop context.
Definition event_ctx.h:42
Definition h2_client.h:52
Definition h2_client.h:91
int timeout_ms
Definition h2_client.h:92
KlTlsConfig * tls
Definition h2_client.h:94
int max_concurrent_streams
Definition h2_client.h:93
KlH2ClientSessionFactory session
Definition h2_client.h:95
Definition h2_client.h:40
KlH2ClientHeader * headers
Definition h2_client.h:42
size_t body_len
Definition h2_client.h:46
char * body
Definition h2_client.h:45
int status
Definition h2_client.h:41
int num_headers
Definition h2_client.h:43
size_t body_cap
Definition h2_client.h:47
int headers_cap
Definition h2_client.h:44
Definition h2_client.h:67
int(* recv)(KlH2ClientSession *self, const char *data, size_t len)
Definition h2_client.h:69
void * keel_ctx
Definition h2_client.h:83
int(* flush)(KlH2ClientSession *self)
Definition h2_client.h:77
void(* destroy)(KlH2ClientSession *self)
Definition h2_client.h:79
int32_t(* submit_request)(KlH2ClientSession *self, const char *method, const char *path, const char *authority, const KlH2ClientHeader *hdrs, int n, const char *body, size_t body_len)
Definition h2_client.h:71
KlH2ClientCallbacks keel_cbs
Definition h2_client.h:81
TLS configuration for KlConfig.
Definition tls.h:108