summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-09-05 21:25:06 +0100
committerAndrew Clayton <a.clayton@nginx.com>2024-09-06 01:35:27 +0100
commitc1c220bf0599166a41681dc3824c7be38631c0e0 (patch)
tree009136d2c6e2e601bcb6a5eeec866204f700293c
parent7d0de8d48e202e32bb2879f706a47a3477cd8e2e (diff)
downloadproject_blackbird-c1c220bf0599166a41681dc3824c7be38631c0e0.tar.gz
project_blackbird-c1c220bf0599166a41681dc3824c7be38631c0e0.tar.bz2
w-h/0.2.0/large-upload: Update for wasmtime v24.0.0
Same issue as commit 92ffa9a ("w-h/0.2.0/echo-request: Update for wasmtime v24.0.0") Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--c/wasi-http/0.2.0/large-upload/Makefile2
-rw-r--r--c/wasi-http/0.2.0/large-upload/component.c7
-rw-r--r--c/wasi-http/0.2.0/large-upload/wasi_snapshot_preview1.reactor.wasmbin96758 -> 0 bytes
3 files changed, 6 insertions, 3 deletions
diff --git a/c/wasi-http/0.2.0/large-upload/Makefile b/c/wasi-http/0.2.0/large-upload/Makefile
index d84c222..f9e3bfe 100644
--- a/c/wasi-http/0.2.0/large-upload/Makefile
+++ b/c/wasi-http/0.2.0/large-upload/Makefile
@@ -23,7 +23,7 @@ module.wasm: bindgen
.PHONY:
component.wasm: module.wasm
- /home/andrew/src/c/wasm/git/wasm-tools/target/release/wasm-tools component new module.wasm --adapt wasi_snapshot_preview1.reactor.wasm -o component.wasm
+ /home/andrew/src/c/wasm/git/wasm-tools/target/release/wasm-tools component new module.wasm --adapt ../../adaptors/24.0.0/wasi_snapshot_preview1.reactor.wasm -o component.wasm
clean:
rm -f component.wasm module.wasm proxy*
diff --git a/c/wasi-http/0.2.0/large-upload/component.c b/c/wasi-http/0.2.0/large-upload/component.c
index 148100d..1030b01 100644
--- a/c/wasi-http/0.2.0/large-upload/component.c
+++ b/c/wasi-http/0.2.0/large-upload/component.c
@@ -30,6 +30,7 @@ void exports_wasi_http_incoming_handler_handle(
wasi_http_types_borrow_incoming_request_t b_req;
wasi_http_types_own_incoming_body_t r_body;
wasi_http_types_borrow_incoming_body_t b_r_body;
+ wasi_http_types_own_outgoing_response_t resp;
wasi_http_types_result_own_outgoing_response_error_code_t rerr = { };
wasi_http_types_own_fields_t hdrs;
wasi_http_types_borrow_fields_t b_hdrs;
@@ -44,6 +45,10 @@ void exports_wasi_http_incoming_handler_handle(
bool ok;
int fd;
+ fields = wasi_http_types_constructor_fields();
+ resp = wasi_http_types_constructor_outgoing_response(fields);
+ rerr.val.ok = resp;
+
fd = open("/var/tmp/wasm-wasi-component-upload.dat",
O_CREAT|O_TRUNC|O_WRONLY, 0666);
@@ -82,8 +87,6 @@ void exports_wasi_http_incoming_handler_handle(
total_bytes_wrote += data.len;
} while (total_bytes_wrote < content_len);
- fields = wasi_http_types_constructor_fields();
- wasi_http_types_constructor_outgoing_response(fields);
wasi_http_types_static_response_outparam_set(response_out, &rerr);
close(fd);
diff --git a/c/wasi-http/0.2.0/large-upload/wasi_snapshot_preview1.reactor.wasm b/c/wasi-http/0.2.0/large-upload/wasi_snapshot_preview1.reactor.wasm
deleted file mode 100644
index 0717d98..0000000
--- a/c/wasi-http/0.2.0/large-upload/wasi_snapshot_preview1.reactor.wasm
+++ /dev/null
Binary files differ