Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Now that the wasi-http 0.2.0 components are using a shared Makefile,
make the echo-request component use the proxy adaptor while the rest use
the reactor adaptor.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
All the examples under c/wasi-http/0.2.0/ use the *same* Makefile.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This shows how to get access to the environment variables and echos
them back to the client.
We need to include wasi:cli/environment@0.2.0 in the proxy world.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Check the status of the open(2) call and return an appropriate HTTP
response code on error.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
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>
|
|
This also shows an example of (at least the best I could figure out) how
to send an error 4xx/5xx response back.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
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>
|
|
Remove the sed commands from the Makefile as the version is no longer
encoded in the function and type names. They're still way too long of
course...
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This makes use of the 'reactor' adaptor for filesystem access via the
preopens method.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This adds a WASI 0.2.0 version of c/wasi-http/echo-request, although
there is no change in component.c, you do now need to link against the
'proxy' adaptor (which is included).
This is for running under wasmtime 17.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|