llhttp-ffi 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/ext/llhttp/api.c +8 -2
- data/ext/llhttp/llhttp.c +4 -4
- data/ext/llhttp/llhttp.h +1 -1
- data/lib/llhttp/parser.rb +7 -1
- data/lib/llhttp/version.rb +1 -1
- data/lib/llhttp.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6af451609178568c6487f75fcece2bf8915e0bec6fd51a44761598382afa5de
|
4
|
+
data.tar.gz: 037b38718ded224ec48808f183b1bf9a5e8f65949eaf0fd64379657233521bd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2947c990fdb5a4909d2c631e417bff9e9003b04d0f7fed674d01d7328f75dab2766d1ec4f3aa591267f94c3cf03be352d6aaebe176a49558703675ba3cc087b7
|
7
|
+
data.tar.gz: 5feb106a0e5f6e92cd1f63b506bc84af6add70565cc1f603a4cdb55ae7af2cbc71bf4f1a68df02b1238bdf25bf08e58255cbc010141817081986578d5b9d1645
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## v0.4.0
|
2
|
+
|
3
|
+
*released on 2021-09-09*
|
4
|
+
|
5
|
+
* `add` [#25](https://github.com/metabahn/llhttp/pull/25) Add support for resetting the parser ([bryanp](https://github.com/bryanp))
|
6
|
+
* `chg` [#23](https://github.com/metabahn/llhttp/pull/23) Update ffi to llhttp 6.0.5 ([bryanp](https://github.com/bryanp))
|
7
|
+
|
1
8
|
## [v0.3.1](https://github.com/metabahn/llhttp/releases/tag/2021-06-25)
|
2
9
|
|
3
10
|
*released on 2021-06-25*
|
data/README.md
CHANGED
data/ext/llhttp/api.c
CHANGED
@@ -69,17 +69,23 @@ extern int wasm_on_url(llhttp_t* p, const char* at, size_t length);
|
|
69
69
|
extern int wasm_on_status(llhttp_t* p, const char* at, size_t length);
|
70
70
|
extern int wasm_on_header_field(llhttp_t* p, const char* at, size_t length);
|
71
71
|
extern int wasm_on_header_value(llhttp_t* p, const char* at, size_t length);
|
72
|
-
extern int wasm_on_headers_complete(llhttp_t * p
|
72
|
+
extern int wasm_on_headers_complete(llhttp_t * p, int status_code,
|
73
|
+
uint8_t upgrade, int should_keep_alive);
|
73
74
|
extern int wasm_on_body(llhttp_t* p, const char* at, size_t length);
|
74
75
|
extern int wasm_on_message_complete(llhttp_t * p);
|
75
76
|
|
77
|
+
static int wasm_on_headers_complete_wrap(llhttp_t* p) {
|
78
|
+
return wasm_on_headers_complete(p, p->status_code, p->upgrade,
|
79
|
+
llhttp_should_keep_alive(p));
|
80
|
+
}
|
81
|
+
|
76
82
|
const llhttp_settings_t wasm_settings = {
|
77
83
|
wasm_on_message_begin,
|
78
84
|
wasm_on_url,
|
79
85
|
wasm_on_status,
|
80
86
|
wasm_on_header_field,
|
81
87
|
wasm_on_header_value,
|
82
|
-
|
88
|
+
wasm_on_headers_complete_wrap,
|
83
89
|
wasm_on_body,
|
84
90
|
wasm_on_message_complete,
|
85
91
|
NULL,
|
data/ext/llhttp/llhttp.c
CHANGED
@@ -1126,7 +1126,7 @@ static llparse_state_t llhttp__internal__run(
|
|
1126
1126
|
case s_n_llhttp__internal__n_consume_content_length:
|
1127
1127
|
s_n_llhttp__internal__n_consume_content_length: {
|
1128
1128
|
size_t avail;
|
1129
|
-
|
1129
|
+
uint64_t need;
|
1130
1130
|
|
1131
1131
|
avail = endp - p;
|
1132
1132
|
need = state->content_length;
|
@@ -1481,7 +1481,7 @@ static llparse_state_t llhttp__internal__run(
|
|
1481
1481
|
case s_n_llhttp__internal__n_consume_content_length_1:
|
1482
1482
|
s_n_llhttp__internal__n_consume_content_length_1: {
|
1483
1483
|
size_t avail;
|
1484
|
-
|
1484
|
+
uint64_t need;
|
1485
1485
|
|
1486
1486
|
avail = endp - p;
|
1487
1487
|
need = state->content_length;
|
@@ -8700,7 +8700,7 @@ static llparse_state_t llhttp__internal__run(
|
|
8700
8700
|
case s_n_llhttp__internal__n_consume_content_length:
|
8701
8701
|
s_n_llhttp__internal__n_consume_content_length: {
|
8702
8702
|
size_t avail;
|
8703
|
-
|
8703
|
+
uint64_t need;
|
8704
8704
|
|
8705
8705
|
avail = endp - p;
|
8706
8706
|
need = state->content_length;
|
@@ -9048,7 +9048,7 @@ static llparse_state_t llhttp__internal__run(
|
|
9048
9048
|
case s_n_llhttp__internal__n_consume_content_length_1:
|
9049
9049
|
s_n_llhttp__internal__n_consume_content_length_1: {
|
9050
9050
|
size_t avail;
|
9051
|
-
|
9051
|
+
uint64_t need;
|
9052
9052
|
|
9053
9053
|
avail = endp - p;
|
9054
9054
|
need = state->content_length;
|
data/ext/llhttp/llhttp.h
CHANGED
data/lib/llhttp/parser.rb
CHANGED
@@ -117,12 +117,18 @@ module LLHttp
|
|
117
117
|
LLHttp.llhttp_should_keep_alive(@pointer) == 1
|
118
118
|
end
|
119
119
|
|
120
|
-
# [public]
|
120
|
+
# [public] Tells the parser we are finished.
|
121
121
|
#
|
122
122
|
def finish
|
123
123
|
LLHttp.llhttp_finish(@pointer)
|
124
124
|
end
|
125
125
|
|
126
|
+
# [public] Get ready to parse the next request/response.
|
127
|
+
#
|
128
|
+
def reset
|
129
|
+
LLHttp.llhttp_reset(@pointer)
|
130
|
+
end
|
131
|
+
|
126
132
|
CALLBACKS.each do |callback|
|
127
133
|
class_eval(
|
128
134
|
<<~RB, __FILE__, __LINE__ + 1
|
data/lib/llhttp/version.rb
CHANGED
data/lib/llhttp.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: llhttp-ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi-compiler
|