Skip to content

copy_req()

copy_req() is using for deep copying the Req object. It is necessary especially for async operations.

typedef struct
{
Res *res;
} ctx_t;
void handler(Req *req, Res *res)
{
ctx_t *ctx = malloc(sizeof(*ctx));
ctx->req = copy_req(req);
}