llhttp-ffi 0.5.0 → 0.5.2
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 +16 -0
- data/ext/aarch64-darwin/libllhttp-ext.bundle +0 -0
- data/lib/llhttp/parser.rb +12 -2
- data/lib/llhttp/version.rb +1 -1
- data/lib/llhttp.rb +1 -0
- metadata +3 -10
- data/ext/aarch64-darwin/llhttp/api.o +0 -0
- data/ext/aarch64-darwin/llhttp/http.o +0 -0
- data/ext/aarch64-darwin/llhttp/llhttp.o +0 -0
- data/ext/aarch64-darwin/llhttp/llhttp_ext.o +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99170bbd6cba8ca71bc354ac1453c1aa8dd1bbc8d0cbf4878a6740494cf09b8e
|
|
4
|
+
data.tar.gz: 1bc54c62ec2477fdca4e5543047a946b8097b3035376cc8f8554710970e42005
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b72004892dd2bd5af4b5b34b7fe6bf1c56ac20e758930f61286e18b432591ead1a31e945dde3951bd1ef2b86510740f8bd26b4556c2084c89a8673d17b690de3
|
|
7
|
+
data.tar.gz: 397e89d28bb5b098a70f96d3e563f9e930af7151e4332d6cb7ece165e219b13983c34dbb5681e9c3209b027bf9dbc31dc52c301a11fecdb18687d3195d687c75
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [v0.5.2](https://github.com/bryanp/llhttp/releases/tag/2026-12-05)
|
|
2
|
+
|
|
3
|
+
*released on 2026-12-05*
|
|
4
|
+
|
|
5
|
+
* `fix` [#45](https://github.com/bryanp/llhttp/pull/45) Raise TypeError when parsing data that is not a string ([bryanp](https://github.com/bryanp))
|
|
6
|
+
* `fix` [#43](https://github.com/bryanp/llhttp/pull/43) Fix truncation of multibyte input ([bryanp](https://github.com/bryanp))
|
|
7
|
+
* `fix` [#39](https://github.com/bryanp/llhttp/pull/39) Retain callback procs for the lifetime of the parser ([sferik](https://github.com/sferik))
|
|
8
|
+
|
|
9
|
+
## [v0.5.1](https://github.com/bryanp/llhttp/releases/tag/2025-03-11)
|
|
10
|
+
|
|
11
|
+
*released on 2025-03-11*
|
|
12
|
+
|
|
13
|
+
* `chg` [#32](https://github.com/bryanp/llhttp/pull/32) Remove Async::IO dependency ([ioquatix](https://github.com/ioquatix))
|
|
14
|
+
|
|
1
15
|
## [v0.5.0](https://github.com/bryanp/llhttp/releases/tag/2023-03-29)
|
|
2
16
|
|
|
3
17
|
*released on 2023-03-29*
|
|
@@ -47,3 +61,5 @@
|
|
|
47
61
|
*released on 2021-03-03*
|
|
48
62
|
|
|
49
63
|
* `add` [#12](https://github.com/bryanp/llhttp/pull/12) Introduce llhttp-ffi for better compatibility ([bryanp](https://github.com/bryanp))
|
|
64
|
+
|
|
65
|
+
|
|
Binary file
|
data/lib/llhttp/parser.rb
CHANGED
|
@@ -62,9 +62,17 @@ module LLHttp
|
|
|
62
62
|
|
|
63
63
|
@callbacks = Callbacks.new
|
|
64
64
|
|
|
65
|
+
# Keep explicit references to the callback procs. JRuby's FFI does not
|
|
66
|
+
# retain Ruby references to procs assigned into FFI::Struct callback
|
|
67
|
+
# fields, so without these the JVM may collect the procs and reclaim
|
|
68
|
+
# their native trampolines while the parser is still in use, after
|
|
69
|
+
# which llhttp_execute completes without invoking any callbacks.
|
|
70
|
+
@callback_procs = []
|
|
71
|
+
|
|
65
72
|
(CALLBACKS + CALLBACKS_WITH_DATA).each do |callback|
|
|
66
73
|
if delegate.respond_to?(callback)
|
|
67
|
-
@
|
|
74
|
+
@callback_procs << (callback_proc = method(callback).to_proc)
|
|
75
|
+
@callbacks[callback] = callback_proc
|
|
68
76
|
end
|
|
69
77
|
end
|
|
70
78
|
|
|
@@ -76,7 +84,9 @@ module LLHttp
|
|
|
76
84
|
# [public] Parse the given data.
|
|
77
85
|
#
|
|
78
86
|
def parse(data)
|
|
79
|
-
|
|
87
|
+
raise TypeError, "wrong argument type #{data.class} (expected String)" unless data.is_a?(String)
|
|
88
|
+
|
|
89
|
+
errno = LLHttp.llhttp_execute(@pointer, data, data.bytesize)
|
|
80
90
|
raise build_error(errno) if errno > 0
|
|
81
91
|
end
|
|
82
92
|
alias_method :<<, :parse
|
data/lib/llhttp/version.rb
CHANGED
data/lib/llhttp.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: llhttp-ffi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bryan Powell
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: ffi-compiler
|
|
@@ -50,10 +49,6 @@ files:
|
|
|
50
49
|
- README.md
|
|
51
50
|
- ext/Rakefile
|
|
52
51
|
- ext/aarch64-darwin/libllhttp-ext.bundle
|
|
53
|
-
- ext/aarch64-darwin/llhttp/api.o
|
|
54
|
-
- ext/aarch64-darwin/llhttp/http.o
|
|
55
|
-
- ext/aarch64-darwin/llhttp/llhttp.o
|
|
56
|
-
- ext/aarch64-darwin/llhttp/llhttp_ext.o
|
|
57
52
|
- ext/llhttp/api.c
|
|
58
53
|
- ext/llhttp/extconf.rb
|
|
59
54
|
- ext/llhttp/http.c
|
|
@@ -69,7 +64,6 @@ homepage: https://github.com/bryanp/llhttp/
|
|
|
69
64
|
licenses:
|
|
70
65
|
- MPL-2.0
|
|
71
66
|
metadata: {}
|
|
72
|
-
post_install_message:
|
|
73
67
|
rdoc_options: []
|
|
74
68
|
require_paths:
|
|
75
69
|
- lib
|
|
@@ -84,8 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
84
78
|
- !ruby/object:Gem::Version
|
|
85
79
|
version: '0'
|
|
86
80
|
requirements: []
|
|
87
|
-
rubygems_version:
|
|
88
|
-
signing_key:
|
|
81
|
+
rubygems_version: 4.0.6
|
|
89
82
|
specification_version: 4
|
|
90
83
|
summary: Ruby FFI bindings for llhttp.
|
|
91
84
|
test_files: []
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|