feat(lnm): implement context resetting
This commit is contained in:
parent
e8bb089f5c
commit
3c1e62330c
6 changed files with 76 additions and 6 deletions
|
|
@ -49,4 +49,12 @@ typedef enum lnm_http_parse_err {
|
|||
*/
|
||||
lnm_http_parse_err lnm_http_req_parse(lnm_http_req *req, char *buf, size_t len);
|
||||
|
||||
/**
|
||||
* Reset the given request object, free'ing all its relevant parts and allowing
|
||||
* it to be reused as a new object.
|
||||
*
|
||||
* @param req object to reset
|
||||
*/
|
||||
void lnm_http_req_reset(lnm_http_req *req);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -108,4 +108,12 @@ void lnm_http_res_body_set_buf(lnm_http_res *res, char *buf, size_t len,
|
|||
*/
|
||||
void lnm_http_res_body_set_fn(lnm_http_res *res, data_fn fn, size_t len);
|
||||
|
||||
/**
|
||||
* Reset the given response object, properly free'ing any allocated buffers,
|
||||
* allowing it to be reused for later connections.
|
||||
*
|
||||
* @param res res to reset
|
||||
*/
|
||||
void lnm_http_res_reset(lnm_http_res *res);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue