Skip to content

Commit

Permalink
Merge pull request #23 from metabahn/chg/ffi/llhttp-6.0.5
Browse files Browse the repository at this point in the history
Update ffi to llhttp 6.0.5
  • Loading branch information
bryanp authored Sep 9, 2021
2 parents f477101 + 1bd793b commit 0aad38a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 8 additions & 2 deletions ffi/ext/llhttp/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ extern int wasm_on_url(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_status(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_header_field(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_header_value(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_headers_complete(llhttp_t * p);
extern int wasm_on_headers_complete(llhttp_t * p, int status_code,
uint8_t upgrade, int should_keep_alive);
extern int wasm_on_body(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_message_complete(llhttp_t * p);

static int wasm_on_headers_complete_wrap(llhttp_t* p) {
return wasm_on_headers_complete(p, p->status_code, p->upgrade,
llhttp_should_keep_alive(p));
}

const llhttp_settings_t wasm_settings = {
wasm_on_message_begin,
wasm_on_url,
wasm_on_status,
wasm_on_header_field,
wasm_on_header_value,
wasm_on_headers_complete,
wasm_on_headers_complete_wrap,
wasm_on_body,
wasm_on_message_complete,
NULL,
Expand Down
8 changes: 4 additions & 4 deletions ffi/ext/llhttp/llhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ static llparse_state_t llhttp__internal__run(
case s_n_llhttp__internal__n_consume_content_length:
s_n_llhttp__internal__n_consume_content_length: {
size_t avail;
size_t need;
uint64_t need;

avail = endp - p;
need = state->content_length;
Expand Down Expand Up @@ -1481,7 +1481,7 @@ static llparse_state_t llhttp__internal__run(
case s_n_llhttp__internal__n_consume_content_length_1:
s_n_llhttp__internal__n_consume_content_length_1: {
size_t avail;
size_t need;
uint64_t need;

avail = endp - p;
need = state->content_length;
Expand Down Expand Up @@ -8700,7 +8700,7 @@ static llparse_state_t llhttp__internal__run(
case s_n_llhttp__internal__n_consume_content_length:
s_n_llhttp__internal__n_consume_content_length: {
size_t avail;
size_t need;
uint64_t need;

avail = endp - p;
need = state->content_length;
Expand Down Expand Up @@ -9048,7 +9048,7 @@ static llparse_state_t llhttp__internal__run(
case s_n_llhttp__internal__n_consume_content_length_1:
s_n_llhttp__internal__n_consume_content_length_1: {
size_t avail;
size_t need;
uint64_t need;

avail = endp - p;
need = state->content_length;
Expand Down
2 changes: 1 addition & 1 deletion ffi/ext/llhttp/llhttp.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define LLHTTP_VERSION_MAJOR 6
#define LLHTTP_VERSION_MINOR 0
#define LLHTTP_VERSION_PATCH 1
#define LLHTTP_VERSION_PATCH 5

#ifndef LLHTTP_STRICT_MODE
# define LLHTTP_STRICT_MODE 0
Expand Down

0 comments on commit 0aad38a

Please sign in to comment.