1
0
Fork 0
libweb/doc/man3/http_update.3

77 lines
1.7 KiB
Groff

.TH HTTP_UPDATE 3 2023-09-06 0.1.0 "libweb Library Reference"
.SH NAME
http_update \- updates a HTTP context object
.SH SYNOPSIS
.LP
.nf
#include <libweb/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 libweb .
.SH SEE ALSO
.BR http_free (3),
.BR http_update (3),
.BR libweb_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.