diff options
Diffstat (limited to 'doc/man3/http_update.3')
| -rw-r--r-- | doc/man3/http_update.3 | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/doc/man3/http_update.3 b/doc/man3/http_update.3 new file mode 100644 index 0000000..7f54608 --- /dev/null +++ b/doc/man3/http_update.3 @@ -0,0 +1,76 @@ +.TH HTTP_UPDATE 3 2023-09-06 0.1.0 "slweb Library Reference" + +.SH NAME +http_update \- updates a HTTP context object + +.SH SYNOPSIS +.LP +.nf +#include <slweb/http.h> +.P +int http_update(struct http_ctx *\fIh\fP, bool *\fIwrite\fP, bool *\fIclose\fP); +.fi + +.SH DESCRIPTION +The +.IR http_update () +function updates a +.I "struct http_ctx" +object previously allocated by +.IR http_alloc (3), +handling any pending data to be received/sent from/to a client. +This function might call one or more of the callbacks defined by the +.I "struct http_cfg" +object given by the previous call to +.IR http_alloc (3). + +.I http_update +shall assign the +.I bool +object pointed to by +.I write +to +.I true +if there is pending data to be sent to the client. Otherwise, it shall +assigned to +.IR false . + +.IR http_update () +shall assign the +.I bool +object pointed to by +.I close +to +.I true +if the connection must be closed by the caller. Otherwise, it shall be +assigned to +.IR false . + +This function should be called anytime there is available data for +input or output. + +.SH RETURN VALUE +On success, zero is returned. If a fatal error ocurrs, a negative +integer is returned. If a non-fatal error caused by malformed client +input occurs, a positive integer is returned and the connection against +the client shall be closed. + +.SH ERRORS +No errors are defined. + +.SH NOTES +This function is designed for internal use by +.IR slweb . + +.SH SEE ALSO +.BR http_free (3), +.BR http_update (3), +.BR slweb_http (7). + +.SH COPYRIGHT +Copyright (C) 2023 Xavier Del Campo Romero. +.P +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. |
