Skip to content

Commit 12cae9b

Browse files
committed
fix(ci): fix proxy_send_local_response ABI + eliminate NULL config path
- Fix argument order in pw_proxy_send_local_response: headers are args[5-6] per proxy-wasm ABI spec, not args[1-2] (which are status_code_details) - Pass empty strings instead of NULL for unconfigured proxy-wasm calls, eliminating the only difference between the working configured path and the failing unconfigured path on x86_64 CI - Add -t 120 timeout to varnishtest to handle slower CI runners - Mark .wasm files as binary in .gitattributes - Reduce block test fuel to 10M (matches passing lifecycle test)
1 parent 37f6619 commit 12cae9b

5 files changed

Lines changed: 17 additions & 14 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# Prevent git from modifying line endings in vendored sources
22
# (cargo checksums are sensitive to byte-exact content)
33
examples/proxy-wasm-filter/vendor/** -text
4+
5+
# Binary Wasm modules must not be modified
6+
*.wasm binary

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ check-local:
1212
@if test -n "$(VARNISHTEST)"; then \
1313
for t in $(srcdir)/tests/*.vtc; do \
1414
echo "Running $$t..."; \
15-
$(VARNISHTEST) \
15+
$(VARNISHTEST) -t 120 \
1616
-Dvmod_wasm="$(abs_top_builddir)/src/.libs/libvmod_wasm.so" \
1717
-Dwasm_module="$(abs_top_srcdir)/tests/wasm/test_module.wasm" \
1818
-Dsdk_module="$(abs_top_srcdir)/tests/wasm/proxy_wasm_filter.wasm" \

src/proxy_wasm.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ pw_proxy_send_local_response(void *env, wasmtime_caller_t *caller,
181181

182182
/*
183183
* ABI: proxy_send_local_response(
184-
* status_code, // args[0] i32
185-
* headers_ptr, // args[1] i32 (serialized header map)
186-
* headers_size, // args[2] i32
187-
* body_ptr, // args[3] i32
188-
* body_size, // args[4] i32
189-
* grpc_status, // args[5] i32 (ignored)
190-
* grpc_status_msg_ptr, // args[6] i32 (ignored)
191-
* grpc_status_msg_size // args[7] i32 (ignored)
184+
* status_code, // args[0] i32
185+
* status_details_ptr, // args[1] i32
186+
* status_details_size, // args[2] i32
187+
* body_ptr, // args[3] i32
188+
* body_size, // args[4] i32
189+
* headers_ptr, // args[5] i32 (serialized header map)
190+
* headers_size, // args[6] i32
191+
* grpc_status // args[7] i32 (ignored)
192192
* )
193193
*/
194194
ctx->local_response_set = 1;
@@ -209,8 +209,8 @@ pw_proxy_send_local_response(void *env, wasmtime_caller_t *caller,
209209
}
210210

211211
/* Capture response headers (serialized proxy-wasm format) */
212-
headers_ptr = (uint32_t)args[1].of.i32;
213-
headers_size = (uint32_t)args[2].of.i32;
212+
headers_ptr = (uint32_t)args[5].of.i32;
213+
headers_size = (uint32_t)args[6].of.i32;
214214
if (headers_size > 0 && pw_validate_region(ctx, headers_ptr, headers_size)) {
215215
free(ctx->local_response_headers);
216216
ctx->local_response_headers = malloc(headers_size);

src/wasm_engine.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ vwasm_proxy_wasm_call(struct vwasm_engine *engine,
975975
int *status_code)
976976
{
977977
return (proxy_wasm_execute(engine, ctx, module_name,
978-
VWASM_PHASE_REQUEST, NULL, NULL, status_code));
978+
VWASM_PHASE_REQUEST, "", "", status_code));
979979
}
980980

981981
int
@@ -985,7 +985,7 @@ vwasm_proxy_wasm_response_call(struct vwasm_engine *engine,
985985
int *status_code)
986986
{
987987
return (proxy_wasm_execute(engine, ctx, module_name,
988-
VWASM_PHASE_RESPONSE, NULL, NULL, status_code));
988+
VWASM_PHASE_RESPONSE, "", "", status_code));
989989
}
990990

991991
int

tests/proxy_wasm_block.vtc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ varnish v1 -vcl+backend {
1010

1111
sub vcl_init {
1212
wasm.load("filter", "${wasm_module}");
13-
wasm.set_fuel(100000000);
13+
wasm.set_fuel(10000000);
1414
}
1515

1616
sub vcl_recv {

0 commit comments

Comments
 (0)