refactor: moved resetting of ctx to separate function

This commit is contained in:
Jef Roosens 2023-05-28 18:24:22 +02:00
parent 590f0e5186
commit 62348c14f5
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
5 changed files with 35 additions and 17 deletions

View file

@ -118,4 +118,11 @@ typedef enum http_response_type {
http_network_authentication_required = 511
} http_response_type;
typedef struct http_response {
http_response_type type;
const char *body;
size_t body_len;
size_t body_written;
} http_response;
#endif

View file

@ -38,6 +38,8 @@ http_loop_gctx *http_loop_gctx_init();
*/
typedef struct http_loop_ctx {
http_request req;
http_response res;
bool flush;
http_route *route;
size_t current_step;
http_loop_gctx *g;
@ -48,6 +50,8 @@ typedef struct http_loop_ctx {
*/
http_loop_ctx *http_loop_ctx_init(http_loop_gctx *g);
void http_loop_ctx_reset(http_loop_ctx *ctx);
/*
* Free a context struct
*/