Skip to content

copy_res()

copy_res() is using for deep copying the Res 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->res = copy_res(res);
}