21static _Atomic
bool g_misuse_reported =
false;
26static void cwist_async_report_misuse(
const char *
what) {
31 "cwist: async misuse: %s; producers must not write res->deferred or "
32 "res->async (see cwist_async_wait_dispatched())\n",
44 if (
a && t_pending_async ==
a) {
45 t_pending_async =
NULL;
51 if (res && t_pending_res == res) {
52 t_pending_async =
NULL;
59 t_pending_async =
NULL;
61 if (!res)
return NULL;
64 cwist_async_report_misuse(
"res->deferred/res->async changed before the dispatch ack");
66 cwist_async_report_misuse(
"res->deferred set without cwist_async_defer()");
72 return res && (res->
deferred || (t_pending_async && t_pending_res == res));
Deferred-response (async handler) API for CWIST.
struct cwist_async cwist_async
Private wiring between the deferred-response path (async.c) and the C1M connection engine (http....
void cwist_async_forget_handle(const cwist_async *a)
bool cwist_async_res_deferred(const cwist_http_response *res)
void cwist_async_forget_response(const cwist_http_response *res)
void cwist_async_record_pending(cwist_async *a, const cwist_http_response *res)
cwist_async * cwist_async_dispatch_take(cwist_http_response *res)
HTTP Response Object. Supports standard string body or Zero-Copy pointer body.
void * async
Owning cwist_async while deferred (read-only).
bool deferred
Deferred-response handoff (internal; see net/http/async.h)