cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
http_live.h File Reference

Classic-pool connection registry hooks for shutdown (private). More...

#include <stdbool.h>
Include dependency graph for http_live.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool cwist_http_live_idle_enter (void)
 
void cwist_http_live_idle_leave (void)
 

Detailed Description

Classic-pool connection registry hooks for shutdown (private).

A classic pool worker registers the connection it serves. Handlers bracket the blocking wait for the next request on a keep-alive connection with cwist_http_live_idle_enter()/_leave(), so shutdown can close idle connections at once and let in-flight requests finish. Outside a classic pool worker both calls are no-ops.

Definition in file http_live.h.

Function Documentation

◆ cwist_http_live_idle_enter()

bool cwist_http_live_idle_enter ( void  )

Mark the calling worker's connection idle (waiting for a new request).

Returns
false when the pool is shutting down: the caller must treat the connection as closed by the peer instead of waiting on it.

Definition at line 423 of file http.c.

References cap.

Referenced by cwist_app_http_handler(), and cwist_http_receive_request().

◆ cwist_http_live_idle_leave()

void cwist_http_live_idle_leave ( void  )

The connection received request bytes; it is no longer idle.

Definition at line 434 of file http.c.

References cap.

Referenced by cwist_app_http_handler(), and cwist_http_receive_request().