Skip to content

Commit 5b0d030

Browse files
ronagindutny
authored andcommitted
pass more info in wasm_on_header_complete
Avoids the need for additional calls into wasm.
1 parent 2f5591a commit 5b0d030

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/native/api.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,18 @@ extern int wasm_on_headers_complete(llhttp_t * p);
5050
extern int wasm_on_body(llhttp_t* p, const char* at, size_t length);
5151
extern int wasm_on_message_complete(llhttp_t * p);
5252

53+
static int wasm_on_headers_complete_wrap(llhttp_t* p) {
54+
return wasm_on_headers_complete(p, p->status_code, p->upgrade,
55+
llhttp_should_keep_alive(p));
56+
}
57+
5358
const llhttp_settings_t wasm_settings = {
5459
wasm_on_message_begin,
5560
wasm_on_url,
5661
wasm_on_status,
5762
wasm_on_header_field,
5863
wasm_on_header_value,
59-
wasm_on_headers_complete,
64+
wasm_on_headers_complete_wrap,
6065
wasm_on_body,
6166
wasm_on_message_complete,
6267
NULL,

0 commit comments

Comments
 (0)