Skip to content

Commit 263541e

Browse files
committed
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 <[email protected]>
1 parent ee64ca5 commit 263541e

File tree

1 file changed

+2
-1
lines changed
  • examples/rust/upload-reflector/src

1 file changed

+2
-1
lines changed

examples/rust/upload-reflector/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ pub fn upload_reflector(ctx: *mut luw_ctx_t) -> i32 {
6565

6666
uwr_http_send_response(ctx);
6767

68-
if unsafe { TOTAL_RESPONSE_SENT == uwr_get_http_content_len(ctx) } {
68+
if unsafe { TOTAL_RESPONSE_SENT == uwr_get_http_content_len(ctx) as usize }
69+
{
6970
// Tell Unit no more data to send
7071
uwr_http_response_end();
7172
}

0 commit comments

Comments
 (0)