copy_res()
copy_res()
is using for deep copying the Res
object. It is necessary especially for async operations.
Res *copy_res(const Res *original);
Example usage:
typedef struct{ Res *res;} ctx_t;
void handler(Req *req, Res *res){ ctx_t *ctx = malloc(sizeof(*ctx)); ctx->res = copy_res(res);}