diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2023-10-17 18:39:57 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2023-10-17 18:39:57 +0100 |
commit | 73d0914bc1d1f3a4b1b3e28815d892ef2143be0f (patch) | |
tree | 61fb14a1bb90b6dc92f033f0df32dbf0dfdf75af /examples/rust/hello-world | |
parent | 63e2d345eb1b6c785dfd3e1559b71aea056edd92 (diff) | |
download | unit-wasm-73d0914bc1d1f3a4b1b3e28815d892ef2143be0f.tar.gz unit-wasm-73d0914bc1d1f3a4b1b3e28815d892ef2143be0f.tar.bz2 |
examples/rust: Further simplify hello-world
In this example we don't need the request buf.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'examples/rust/hello-world')
-rw-r--r-- | examples/rust/hello-world/src/lib.rs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/examples/rust/hello-world/src/lib.rs b/examples/rust/hello-world/src/lib.rs index a06bb4a..e2eae48 100644 --- a/examples/rust/hello-world/src/lib.rs +++ b/examples/rust/hello-world/src/lib.rs @@ -11,10 +11,8 @@ use unit_wasm::rusty::*; #[no_mangle] pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 { let ctx = &mut UWR_CTX_INITIALIZER(); - let mut request_buf: *mut u8 = std::ptr::null_mut(); uwr_init_ctx(ctx, addr, 4096); - uwr_set_req_buf(ctx, &mut request_buf, LUW_SRB_ALLOC); uwr_write_str!( ctx, @@ -34,7 +32,5 @@ pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 { uwr_http_send_response(ctx); uwr_http_response_end(); - uwr_free(request_buf); - return 0; } |