From f748851daf87ce40cd2fed8c205afc4482c689a1 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 29 Aug 2023 23:23:05 +0100 Subject: Rust/rusty: Re-order some functions more logically This may not matter in rust (if you use a function before the compiler has seen a definition for it), but anyway in preparation for adding a uwr_get_http_total_content_sent() function, put the content length related functions before the functions that return the content. Signed-off-by: Andrew Clayton --- src/rust/unit-wasm-sys/rusty.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/rust/unit-wasm-sys/rusty.rs b/src/rust/unit-wasm-sys/rusty.rs index 5135f56..be7a5e1 100644 --- a/src/rust/unit-wasm-sys/rusty.rs +++ b/src/rust/unit-wasm-sys/rusty.rs @@ -95,14 +95,18 @@ pub fn uwr_get_http_server_name(ctx: *const luw_ctx_t) -> &'static str { C2S!(luw_get_http_server_name(ctx)) } -pub fn uwr_get_http_content(ctx: *const luw_ctx_t) -> *const u8 { - unsafe { luw_get_http_content(ctx) } -} - pub fn uwr_get_http_content_len(ctx: *const luw_ctx_t) -> usize { unsafe { luw_get_http_content_len(ctx) } } +pub fn uwr_get_http_content_sent(ctx: *const luw_ctx_t) -> usize { + unsafe { luw_get_http_content_sent(ctx) } +} + +pub fn uwr_get_http_content(ctx: *const luw_ctx_t) -> *const u8 { + unsafe { luw_get_http_content(ctx) } +} + pub fn uwr_get_http_content_str(ctx: *const luw_ctx_t) -> &'static str { unsafe { let slice = slice::from_raw_parts( @@ -113,10 +117,6 @@ pub fn uwr_get_http_content_str(ctx: *const luw_ctx_t) -> &'static str { } } -pub fn uwr_get_http_content_sent(ctx: *const luw_ctx_t) -> usize { - unsafe { luw_get_http_content_sent(ctx) } -} - pub fn uwr_http_is_tls(ctx: *const luw_ctx_t) -> bool { unsafe { luw_http_is_tls(ctx) } } -- cgit