summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c/include/unit/unit-wasm.h1
-rw-r--r--src/c/libunit-wasm.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/c/include/unit/unit-wasm.h b/src/c/include/unit/unit-wasm.h
index cc14b9d..834e4f1 100644
--- a/src/c/include/unit/unit-wasm.h
+++ b/src/c/include/unit/unit-wasm.h
@@ -176,6 +176,7 @@ extern const char *luw_get_http_server_name(const luw_ctx_t *ctx);
extern const u8 *luw_get_http_content(const luw_ctx_t *ctx);
extern size_t luw_get_http_content_len(const luw_ctx_t *ctx);
extern size_t luw_get_http_content_sent(const luw_ctx_t *ctx);
+extern size_t luw_get_http_total_content_sent(const luw_ctx_t *ctx);
extern bool luw_http_is_tls(const luw_ctx_t *ctx);
extern void luw_http_hdr_iter(luw_ctx_t *ctx,
bool (*luw_http_hdr_iter_func)(luw_ctx_t *ctx,
diff --git a/src/c/libunit-wasm.c b/src/c/libunit-wasm.c
index c0c02c5..69fe4c0 100644
--- a/src/c/libunit-wasm.c
+++ b/src/c/libunit-wasm.c
@@ -207,6 +207,12 @@ size_t luw_get_http_content_sent(const luw_ctx_t *ctx)
return ctx->req->content_sent;
}
+/* Returns the size of the overall content sent so far */
+size_t luw_get_http_total_content_sent(const luw_ctx_t *ctx)
+{
+ return ctx->req->total_content_sent;
+}
+
bool luw_http_is_tls(const luw_ctx_t *ctx)
{
return ctx->req->tls;