Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 5dc0cf0

Browse files
committed
Rust/rusty: Add a wrapper for luw_get_http_total_content_sent()
This returns the total amount of content that the Wasm module has received so far. Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent f748851 commit 5dc0cf0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

API-Rust.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ and there isn't a real need to create wrappers specifically for them.
6767
* [uwr_get_http_content_str](#uwr_get_http_content_str)
6868
* [uwr_get_http_content_len](#uwr_get_http_content_len)
6969
* [uwr_get_http_content_sent](#uwr_get_http_content_sent)
70+
* [uwr_get_http_total_content_sent](#uwr_get_http_total_content_sent)
7071
* [uwr_http_is_tls](#uwr_http_is_tls)
7172
* [uwr_http_hdr_iter](#uwr_http_hdr_iter)
7273
* [uwr_http_hdr_get_value](#uwr_http_hdr_get_value)
@@ -622,6 +623,16 @@ This function returns the length of the content that was sent to the
622623
WebAssembly module in _this_ request. Remember, a single HTTP request may be
623624
split over several calls to luw_request_handler().
624625

626+
### uwr_get_http_total_content_sent
627+
628+
```Rust
629+
pub fn uwr_get_http_total_content_sent(ctx: *const luw_ctx_t) -> usize;
630+
```
631+
632+
This function returns the total length of the content that was sent to the
633+
WebAssembly module so far. Remember, a single HTTP request may be split over
634+
several calls to luw_request_handler().
635+
625636
### uwr_http_is_tls
626637

627638
```Rust

src/rust/unit-wasm-sys/rusty.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ pub fn uwr_get_http_content_sent(ctx: *const luw_ctx_t) -> usize {
103103
unsafe { luw_get_http_content_sent(ctx) }
104104
}
105105

106+
pub fn uwr_get_http_total_content_sent(ctx: *const luw_ctx_t) -> usize {
107+
unsafe { luw_get_http_total_content_sent(ctx) }
108+
}
109+
106110
pub fn uwr_get_http_content(ctx: *const luw_ctx_t) -> *const u8 {
107111
unsafe { luw_get_http_content(ctx) }
108112
}

0 commit comments

Comments
 (0)