summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-02-13 16:21:49 +0000
committerAndrew Clayton <a.clayton@nginx.com>2024-02-21 16:20:32 +0000
commit60eb6c43a71fb0f6cf21759917e0247bdb88b892 (patch)
tree2a4eebd80f3756790d4f6001b556d0ee12322255
parent98f808af2c23966e49abc7b2556e40adddbb51b9 (diff)
downloadunit-60eb6c43a71fb0f6cf21759917e0247bdb88b892.tar.gz
unit-60eb6c43a71fb0f6cf21759917e0247bdb88b892.tar.bz2
Wasm-wc: Allow to use the 'reactor' adaptor again
With the initial port to wasmtime 17 we could no longer use the 'reactor' adaptor but had to switch to the more restrictive 'proxy' adaptor. This meant amongst other things (probably) we could no longer access the filesystem. Thanks to Joel Dice for pointing out the fix. With this we can go back to using the 'reactor' adaptor again and things are back to working as before. It's worth noting that you can use either the 'proxy' or 'reactor' adaptor depending on your requirements. Cc: Joel Dice <joel.dice@fermyon.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--src/wasm-wasi-component/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wasm-wasi-component/src/lib.rs b/src/wasm-wasi-component/src/lib.rs
index 888074ab..3ee40c4f 100644
--- a/src/wasm-wasi-component/src/lib.rs
+++ b/src/wasm-wasi-component/src/lib.rs
@@ -200,7 +200,8 @@ impl GlobalState {
let component = Component::from_file(&engine, &global_config.component)
.context("failed to compile component")?;
let mut linker = Linker::<StoreState>::new(&engine);
- wasmtime_wasi_http::proxy::add_to_linker(&mut linker)?;
+ wasmtime_wasi::preview2::command::add_to_linker(&mut linker)?;
+ wasmtime_wasi_http::proxy::add_only_http_to_linker(&mut linker)?;
let component = linker
.instantiate_pre(&component)
.context("failed to pre-instantiate the provided component")?;