From 263541e24546ba0a75e26fef3c5442238d9fcac2 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 19 Sep 2023 23:46:12 +0100 Subject: examples/rust: Amend upload-reflector for recent changes The previous commit changed uwr_get_http_content_len() to return a u64 to allow for uploads larger than 4GiB, which now means this generates compiler errors about type mismatches, expected usize got u64. Cast the return value of uwr_get_http_content_len() to usize to match that of TOTAL_RESPONSE_SENT. (Making TOTAL_RESPONSE_SENT a u64 creates a larger trail of problems). Signed-off-by: Andrew Clayton --- examples/rust/upload-reflector/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/rust/upload-reflector/src/lib.rs b/examples/rust/upload-reflector/src/lib.rs index 753ea48..ac48b56 100644 --- a/examples/rust/upload-reflector/src/lib.rs +++ b/examples/rust/upload-reflector/src/lib.rs @@ -65,7 +65,8 @@ pub fn upload_reflector(ctx: *mut luw_ctx_t) -> i32 { uwr_http_send_response(ctx); - if unsafe { TOTAL_RESPONSE_SENT == uwr_get_http_content_len(ctx) } { + if unsafe { TOTAL_RESPONSE_SENT == uwr_get_http_content_len(ctx) as usize } + { // Tell Unit no more data to send uwr_http_response_end(); } -- cgit