llhttp 0.0.3 → 0.1.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 +12 -0
- data/LICENSE +353 -22
- data/ext/llhttp/api.c +62 -2
- data/ext/llhttp/http.c +31 -2
- data/ext/llhttp/llhttp.c +9679 -853
- data/ext/llhttp/llhttp.h +104 -26
- data/ext/llhttp/llhttp_ext.c +146 -75
- data/ext/x86_64-darwin/libllhttp-ext.bundle +0 -0
- data/ext/x86_64-darwin/llhttp/api.o +0 -0
- data/ext/x86_64-darwin/llhttp/http.o +0 -0
- data/ext/x86_64-darwin/llhttp/llhttp.o +0 -0
- data/ext/x86_64-darwin/llhttp/llhttp_ext.o +0 -0
- data/lib/llhttp/delegate.rb +71 -39
- data/lib/llhttp/parser.rb +3 -1
- data/lib/llhttp/version.rb +1 -1
- data/lib/llhttp_ext.bundle +0 -0
- metadata +10 -4
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/llhttp/delegate.rb
CHANGED
@@ -8,58 +8,90 @@ module LLHttp
|
|
8
8
|
# ...
|
9
9
|
# end
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# def on_url(url)
|
12
|
+
# ...
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# def on_status(status)
|
16
|
+
# ...
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# def on_header_field(field)
|
20
|
+
# ...
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# def on_header_value(value)
|
24
|
+
# ...
|
25
|
+
# end
|
26
|
+
#
|
27
|
+
# def on_headers_complete
|
28
|
+
# ...
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# def on_body(body)
|
32
|
+
# ...
|
33
|
+
# end
|
34
|
+
#
|
35
|
+
# def on_message_complete
|
36
|
+
# ...
|
37
|
+
# end
|
38
|
+
#
|
39
|
+
# def on_chunk_header
|
40
|
+
# ...
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
# def on_chunk_complete
|
44
|
+
# ...
|
45
|
+
# end
|
46
|
+
#
|
47
|
+
# def on_url_complete
|
48
|
+
# ...
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# def on_status_complete
|
52
|
+
# ...
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# def on_header_field_complete
|
56
|
+
# ...
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# def on_header_value_complete
|
60
|
+
# ...
|
61
|
+
# end
|
12
62
|
# end
|
13
63
|
#
|
14
64
|
class Delegate
|
15
|
-
|
16
|
-
|
17
|
-
def on_message_begin
|
18
|
-
end
|
65
|
+
private def internal_on_message_begin
|
66
|
+
on_message_begin
|
19
67
|
|
20
|
-
|
21
|
-
|
22
|
-
|
68
|
+
0
|
69
|
+
rescue
|
70
|
+
-1
|
23
71
|
end
|
24
72
|
|
25
|
-
|
26
|
-
|
27
|
-
def on_status(status)
|
28
|
-
end
|
73
|
+
private def internal_on_headers_complete
|
74
|
+
on_headers_complete
|
29
75
|
|
30
|
-
|
31
|
-
|
32
|
-
|
76
|
+
0
|
77
|
+
rescue
|
78
|
+
-1
|
33
79
|
end
|
34
80
|
|
35
|
-
|
36
|
-
|
37
|
-
def on_header_value(value)
|
38
|
-
end
|
81
|
+
private def internal_on_message_complete
|
82
|
+
on_message_complete
|
39
83
|
|
40
|
-
|
41
|
-
|
42
|
-
|
84
|
+
0
|
85
|
+
rescue
|
86
|
+
-1
|
43
87
|
end
|
44
88
|
|
45
|
-
|
46
|
-
|
47
|
-
def on_body(body)
|
48
|
-
end
|
49
|
-
|
50
|
-
# [public]
|
51
|
-
#
|
52
|
-
def on_message_complete
|
53
|
-
end
|
54
|
-
|
55
|
-
# [public]
|
56
|
-
#
|
57
|
-
def on_chunk_header
|
58
|
-
end
|
89
|
+
private def internal_on_chunk_header
|
90
|
+
on_chunk_header
|
59
91
|
|
60
|
-
|
61
|
-
|
62
|
-
|
92
|
+
0
|
93
|
+
rescue
|
94
|
+
-1
|
63
95
|
end
|
64
96
|
end
|
65
97
|
end
|
data/lib/llhttp/parser.rb
CHANGED
@@ -20,8 +20,10 @@ module LLHttp
|
|
20
20
|
# Introspection
|
21
21
|
#
|
22
22
|
# * `LLHttp::Parser#content_length` returns the content length of the current request.
|
23
|
-
# * `LLHttp::Parser#
|
23
|
+
# * `LLHttp::Parser#method_name` returns the method name of the current response.
|
24
24
|
# * `LLHttp::Parser#status_code` returns the status code of the current response.
|
25
|
+
# * `LLHttp::Parser#http_major` returns the major http version of the current request/response.
|
26
|
+
# * `LLHttp::Parser#http_minor` returns the minor http version of the current request/response.
|
25
27
|
# * `LLHttp::Parser#keep_alive?` returns `true` if there might be more messages.
|
26
28
|
#
|
27
29
|
# Finishing
|
data/lib/llhttp/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: llhttp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.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:
|
11
|
+
date: 2021-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby bindings for llhttp.
|
14
14
|
email: bryan@metabahn.com
|
@@ -26,14 +26,20 @@ files:
|
|
26
26
|
- ext/llhttp/llhttp.c
|
27
27
|
- ext/llhttp/llhttp.h
|
28
28
|
- ext/llhttp/llhttp_ext.c
|
29
|
+
- ext/x86_64-darwin/libllhttp-ext.bundle
|
30
|
+
- ext/x86_64-darwin/llhttp/api.o
|
31
|
+
- ext/x86_64-darwin/llhttp/http.o
|
32
|
+
- ext/x86_64-darwin/llhttp/llhttp.o
|
33
|
+
- ext/x86_64-darwin/llhttp/llhttp_ext.o
|
29
34
|
- lib/llhttp.rb
|
30
35
|
- lib/llhttp/delegate.rb
|
31
36
|
- lib/llhttp/error.rb
|
32
37
|
- lib/llhttp/parser.rb
|
33
38
|
- lib/llhttp/version.rb
|
39
|
+
- lib/llhttp_ext.bundle
|
34
40
|
homepage: https://github.com/metabahn/llhttp/
|
35
41
|
licenses:
|
36
|
-
-
|
42
|
+
- MPL-2.0
|
37
43
|
metadata: {}
|
38
44
|
post_install_message:
|
39
45
|
rdoc_options: []
|
@@ -50,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
56
|
- !ruby/object:Gem::Version
|
51
57
|
version: '0'
|
52
58
|
requirements: []
|
53
|
-
rubygems_version: 3.2.
|
59
|
+
rubygems_version: 3.2.4
|
54
60
|
signing_key:
|
55
61
|
specification_version: 4
|
56
62
|
summary: Ruby bindings for llhttp.
|