llhttp 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/ext/llhttp/llhttp_ext.c +16 -2
- data/lib/llhttp/parser.rb +1 -1
- data/lib/llhttp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: deed0031ebf36b3f0243f832465d3966c1ebe7237363ac1f5f26634871572739
|
|
4
|
+
data.tar.gz: 9df545c4393d3f0b04fa0d000584c1f002ffd682a586942a5e98a9aae85683b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 51f44b0a48898cc75ba681850b0ed3b63392a24b0041fc6b509eabe2b8f4eb477ef6a7b4904b7a8410e41b25cddc4711b7719a8d35cf261a782bb3d8c222496b
|
|
7
|
+
data.tar.gz: 3f4df743b18910cfcab045576710a2d4f202e4017863da11b7bbba4c82f831f65eeeb16ff06b43683bd37122a67927d4da009b6ec9b86d8725b23ad0ce08f2c1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [v0.6.3](https://github.com/bryanp/llhttp/releases/tag/2026-12-05)
|
|
2
|
+
|
|
3
|
+
*released on 2026-12-05*
|
|
4
|
+
|
|
5
|
+
* `fix` [#46](https://github.com/bryanp/llhttp/pull/46) Load the native extension from the load path ([Annih](https://github.com/Annih))
|
|
6
|
+
* `fix` [#45](https://github.com/bryanp/llhttp/pull/45) Raise TypeError when parsing data that is not a string ([bryanp](https://github.com/bryanp))
|
|
7
|
+
* `fix` [#40](https://github.com/bryanp/llhttp/pull/40) Mark the delegate so the parser survives GC compaction ([benubois](https://github.com/benubois))
|
|
8
|
+
|
|
1
9
|
## [v0.6.2](https://github.com/bryanp/llhttp/releases/tag/2026-06-28)
|
|
2
10
|
|
|
3
11
|
*released on 2026-06-28*
|
data/ext/llhttp/llhttp_ext.c
CHANGED
|
@@ -28,6 +28,18 @@ typedef struct {
|
|
|
28
28
|
ID on_header_value_complete;
|
|
29
29
|
} rb_llhttp_parser_data;
|
|
30
30
|
|
|
31
|
+
static void rb_llhttp_mark(void *data) {
|
|
32
|
+
llhttp_t *parser = data;
|
|
33
|
+
rb_llhttp_parser_data *parserData = (rb_llhttp_parser_data*) parser->data;
|
|
34
|
+
|
|
35
|
+
// If `parserData` is not `0`, mark the delegate so it is pinned. The delegate
|
|
36
|
+
// is cached in `parserData`, which would be left dangling if compaction moved it.
|
|
37
|
+
//
|
|
38
|
+
if (parserData != 0) {
|
|
39
|
+
rb_gc_mark(parserData->delegate);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
static void rb_llhttp_free(void *data) {
|
|
32
44
|
llhttp_t *parser = data;
|
|
33
45
|
rb_llhttp_parser_data *parserData = (rb_llhttp_parser_data*) parser->data;
|
|
@@ -49,7 +61,7 @@ static size_t rb_llhttp_memsize(const void *data) {
|
|
|
49
61
|
|
|
50
62
|
static const rb_data_type_t rb_llhttp_type = {
|
|
51
63
|
"LLHttp::Parser",
|
|
52
|
-
{
|
|
64
|
+
{rb_llhttp_mark, rb_llhttp_free, rb_llhttp_memsize,},
|
|
53
65
|
0, 0, 0,
|
|
54
66
|
};
|
|
55
67
|
#endif
|
|
@@ -71,7 +83,7 @@ VALUE rb_llhttp_allocate(VALUE klass) {
|
|
|
71
83
|
#ifdef TypedData_Make_Struct
|
|
72
84
|
VALUE self = TypedData_Make_Struct(klass, llhttp_t, &rb_llhttp_type, parser);
|
|
73
85
|
#else
|
|
74
|
-
VALUE self = Data_Make_Struct(klass, llhttp_t,
|
|
86
|
+
VALUE self = Data_Make_Struct(klass, llhttp_t, rb_llhttp_mark, rb_llhttp_free, parser);
|
|
75
87
|
#endif
|
|
76
88
|
|
|
77
89
|
// Set data to false so we know when the parser has been initialized.
|
|
@@ -198,6 +210,8 @@ VALUE rb_llhttp_parse(VALUE self, VALUE data) {
|
|
|
198
210
|
|
|
199
211
|
parser = rb_llhttp_get(self);
|
|
200
212
|
|
|
213
|
+
Check_Type(data, T_STRING);
|
|
214
|
+
|
|
201
215
|
enum llhttp_errno err = llhttp_execute(parser, RSTRING_PTR(data), RSTRING_LEN(data));
|
|
202
216
|
|
|
203
217
|
if (err != HPE_OK) {
|
data/lib/llhttp/parser.rb
CHANGED
data/lib/llhttp/version.rb
CHANGED