Skip to content

Commit

Permalink
examples/rust: Amend upload-reflector for recent changes
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ac000 committed Sep 25, 2023
1 parent ee64ca5 commit 263541e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/rust/upload-reflector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 263541e

Please sign in to comment.