diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-12 16:59:55 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-12 16:59:55 +0100 |
| commit | 87807c690947f4636dc4dd7fddca15f944719f0c (patch) | |
| tree | 0696d61b91a3e5f40a34cf09ac6c715584af5744 /doc/man7/libweb_http.7 | |
| parent | 16f07314e675dd7d9d9cfb44dfb33cd81b13590d (diff) | |
| download | libweb-87807c690947f4636dc4dd7fddca15f944719f0c.tar.gz | |
Add HTTP op and resource to length callback
Users might want to know which HTTP operation (i.e., POST or PUT) and/or
resource is being requested before determining whether the request
should be accepted or not.
Diffstat (limited to 'doc/man7/libweb_http.7')
| -rw-r--r-- | doc/man7/libweb_http.7 | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/doc/man7/libweb_http.7 b/doc/man7/libweb_http.7 index 39fd4a5..ba32a99 100644 --- a/doc/man7/libweb_http.7 +++ b/doc/man7/libweb_http.7 @@ -90,7 +90,7 @@ struct http_cfg int (*\fIread\fP)(void *\fIbuf\fP, size_t \fIn\fP, void *\fIuser\fP); int (*\fIwrite\fP)(const void *\fIbuf\fP, size_t \fIn\fP, void *\fIuser\fP); int (*\fIpayload\fP)(const struct http_payload *\fIp\fP, struct http_response *\fIr\fP, void *\fIuser\fP); - int (*\fIlength\fP)(unsigned long long \fIlen\fP, const struct http_cookie *\fIc\fP, struct http_response *\fIr\fP, void *\fIuser\fP); + int (*\fIlength\fP)(enum http_op \fIop\fP, const char *\fIres\fP, unsigned long long \fIlen\fP, const struct http_cookie *\fIc\fP, struct http_response *\fIr\fP, void *\fIuser\fP); const char *\fItmpdir\fP; void *\fIuser\fP; size_t \fImax_headers\fP; @@ -182,6 +182,11 @@ In the case of a request, .I len defines the length of the file body. +.I op +can be used to distinguish the request type, +whereas +.I res +can be used to determine which resource is being accessed by the request. .I c is a read-only pointer to a .I "struct http_cookie" @@ -200,8 +205,11 @@ only when the function returns a positive integer. This function returns zero on success, a negative integer in case of a fatal error or a positive integer in case of a non-fatal error caused by a malformed request, or to indicate a lack of support for -this feature. When a positive integer is returned, the connection -against the client shall be closed. +this feature. When a positive integer is returned, the response pointed +to by +.I r +is sent to the client and the connection +against the client shall be closed afterwards. .I tmpdir is a null-terminated string defining the path to a directory where |
