refactor: moved resetting of ctx to separate function
This commit is contained in:
parent
590f0e5186
commit
62348c14f5
5 changed files with 35 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue