llhttp 0.0.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- # [public]
16
- #
17
- def on_message_begin
18
- end
65
+ private def internal_on_message_begin
66
+ on_message_begin
19
67
 
20
- # [public]
21
- #
22
- def on_url(url)
68
+ 0
69
+ rescue
70
+ -1
23
71
  end
24
72
 
25
- # [public]
26
- #
27
- def on_status(status)
28
- end
73
+ private def internal_on_headers_complete
74
+ on_headers_complete
29
75
 
30
- # [public]
31
- #
32
- def on_header_field(field)
76
+ 0
77
+ rescue
78
+ -1
33
79
  end
34
80
 
35
- # [public]
36
- #
37
- def on_header_value(value)
38
- end
81
+ private def internal_on_message_complete
82
+ on_message_complete
39
83
 
40
- # [public]
41
- #
42
- def on_headers_complete
84
+ 0
85
+ rescue
86
+ -1
43
87
  end
44
88
 
45
- # [public]
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
- # [public]
61
- #
62
- def on_chunk_complete
92
+ 0
93
+ rescue
94
+ -1
63
95
  end
64
96
  end
65
97
  end
data/lib/llhttp/parser.rb CHANGED
@@ -20,14 +20,20 @@ module LLHttp
20
20
  # Introspection
21
21
  #
22
22
  # * `LLHttp::Parser#content_length` returns the content length of the current request.
23
- # * `LLHttp::Parser#method` returns the method of the current response.
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
28
30
  #
29
31
  # Call `LLHttp::Parser#finish` when processing is complete for the current request or response.
30
32
  #
33
+ # Resetting
34
+ #
35
+ # Call `LLHttp::Parser#reset` to reset the parser for the next request or response.
36
+ #
31
37
  class Parser
32
38
  LLHTTP_TYPES = {both: 0, request: 1, response: 2}.freeze
33
39
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LLHttp
4
- VERSION = "0.0.3"
4
+ VERSION = "0.4.0"
5
5
 
6
6
  # [public] LLHttp's current version.
7
7
  #
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.3
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: 2020-12-31 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby bindings for llhttp.
14
14
  email: bryan@metabahn.com
@@ -33,7 +33,7 @@ files:
33
33
  - lib/llhttp/version.rb
34
34
  homepage: https://github.com/metabahn/llhttp/
35
35
  licenses:
36
- - MIT
36
+ - MPL-2.0
37
37
  metadata: {}
38
38
  post_install_message:
39
39
  rdoc_options: []
@@ -43,14 +43,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.5.0
46
+ version: 2.6.7
47
47
  required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  requirements: []
53
- rubygems_version: 3.2.3
53
+ rubygems_version: 3.2.15
54
54
  signing_key:
55
55
  specification_version: 4
56
56
  summary: Ruby bindings for llhttp.