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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 587b610dc8133b3cad26a796f5b5b8f233f7a22f412f311622e56dc4e104f22d
4
- data.tar.gz: e274ee30502f1a585e0957973f9f8c904d63c354e61a9604aec3efa918ed461e
3
+ metadata.gz: deed0031ebf36b3f0243f832465d3966c1ebe7237363ac1f5f26634871572739
4
+ data.tar.gz: 9df545c4393d3f0b04fa0d000584c1f002ffd682a586942a5e98a9aae85683b6
5
5
  SHA512:
6
- metadata.gz: 3976724436b35bd5bc09fd08d4e8631673da1cb69f771328b219ea0a61cf19a9ba5f406bbfdd46dc213fc808a9b4dc20a7fa70d34f5e602118919b234dcdfd94
7
- data.tar.gz: ddca2e5d0df353f438acfb4091a5d811e4ce05725bdcc159174cfa7b27cce6b8437d2008423876e5aca84e0f756e39c6c88bb9e559180f738c7569ea238c304c
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*
@@ -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
- {0, rb_llhttp_free, rb_llhttp_memsize,},
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, 0, rb_llhttp_free, parser);
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
@@ -49,4 +49,4 @@ module LLHttp
49
49
  end
50
50
  end
51
51
 
52
- require_relative "../llhttp_ext"
52
+ require "llhttp_ext"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LLHttp
4
- VERSION = "0.6.2"
4
+ VERSION = "0.6.3"
5
5
 
6
6
  # [public] LLHttp's current version.
7
7
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llhttp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell