summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-09-05 16:43:14 +0100
committerAndrew Clayton <a.clayton@nginx.com>2024-09-05 16:43:14 +0100
commit92ffa9a80c4dbcaa6ee5c82f5c642038f26810d5 (patch)
treee2f2c45191721819bcc9dcbb237390e0bacf0bde
parent3e0fa223fd8f82d2e518a178f7d02262c99c1e03 (diff)
downloadproject_blackbird-92ffa9a80c4dbcaa6ee5c82f5c642038f26810d5.tar.gz
project_blackbird-92ffa9a80c4dbcaa6ee5c82f5c642038f26810d5.tar.bz2
w-h/0.2.0/echo-request: Update for wasmtime v24.0.0
It seems at some point between wasmtime v17 and v24 the setting of wasi_http_types_result_own_outgoing_response_error_code_t's val.ok member became mandatory. I was seeing an error like error: hyper::Error(User(Service), guest never invoked `response-outparam::set` method: error while executing at wasm backtrace: 0: 0x313b5 - wit-component:shim!indirect-wasi:http/types@0.2.0-[static]response-outparam.set 1: 0x4f9a - module.wasm!wasi_http_types_static_response_outparam_set 2: 0x6253 - module.wasm!exports_wasi_http_incoming_handler_handle 3: 0x54e4 - module.wasm!__wasm_export_exports_wasi_http_incoming_handler_handle Caused by: unknown handle index 0) Thanks to <https://github.com/cdmurph32> who it seems somehow found this code and had updated it accordingly. Link: <https://github.com/cdmurph32/pdf-text-example/blob/main/hello_world.c#L173> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--c/wasi-http/0.2.0/echo-request/Makefile2
-rw-r--r--c/wasi-http/0.2.0/echo-request/component.c1
-rw-r--r--c/wasi-http/0.2.0/echo-request/wasi_snapshot_preview1.proxy.wasmbin28355 -> 0 bytes
3 files changed, 2 insertions, 1 deletions
diff --git a/c/wasi-http/0.2.0/echo-request/Makefile b/c/wasi-http/0.2.0/echo-request/Makefile
index 5cfa09d..9dc5329 100644
--- a/c/wasi-http/0.2.0/echo-request/Makefile
+++ b/c/wasi-http/0.2.0/echo-request/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.proxy.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.proxy.wasm -o component.wasm
clean:
rm -f component.wasm module.wasm proxy*
diff --git a/c/wasi-http/0.2.0/echo-request/component.c b/c/wasi-http/0.2.0/echo-request/component.c
index 6f4c626..523bfa2 100644
--- a/c/wasi-http/0.2.0/echo-request/component.c
+++ b/c/wasi-http/0.2.0/echo-request/component.c
@@ -140,6 +140,7 @@ void exports_wasi_http_incoming_handler_handle(
ex("wasi_http_types_method_fields_append() failed\n");
resp = wasi_http_types_constructor_outgoing_response(fields);
+ rerr.val.ok = resp;
b_resp = wasi_http_types_borrow_outgoing_response(resp);
ok = wasi_http_types_method_outgoing_response_body(b_resp, &body);
diff --git a/c/wasi-http/0.2.0/echo-request/wasi_snapshot_preview1.proxy.wasm b/c/wasi-http/0.2.0/echo-request/wasi_snapshot_preview1.proxy.wasm
deleted file mode 100644
index 5f71e3e..0000000
--- a/c/wasi-http/0.2.0/echo-request/wasi_snapshot_preview1.proxy.wasm
+++ /dev/null
Binary files differ