protocol-http2 0.15.1 → 0.17.0
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
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/http2/connection.rb +17 -2
- data/lib/protocol/http2/framer.rb +10 -6
- data/lib/protocol/http2/server.rb +3 -1
- data/lib/protocol/http2/version.rb +1 -1
- data/license.md +1 -1
- data/readme.md +8 -0
- data.tar.gz.sig +0 -0
- metadata +4 -46
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20ea1a9636c45a186fe714ec65ae7160bca6d76b2629416bce0b42940e35a8d6
|
4
|
+
data.tar.gz: 2197763799c0b2e70b24b0f95b10e1eeef2831a540346d65ca71334bdc83615e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d853eadb2b0bdac2940bf4338c6afd2376e2857c1516d9306736792122ff0a8409ac906e77e16c5c465e85f018365c184a03de6f6d7631181ecde6322328f71
|
7
|
+
data.tar.gz: f989baa4230ebc3d511ee5a49836e3c794b7a6eba01e309b33471fe73effc4354c4e0929bc86a770f19663585e8d252942b184d4cda8d85d779e28babc0be5e5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -143,9 +143,14 @@ module Protocol
|
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
|
+
def synchronize
|
147
|
+
yield
|
148
|
+
end
|
149
|
+
|
146
150
|
# Reads one frame from the network and processes. Processing the frame updates the state of the connection and related streams. If the frame triggers an error, e.g. a protocol error, the connection will typically emit a goaway frame and re-raise the exception. You should continue processing frames until the underlying connection is closed.
|
147
151
|
def read_frame
|
148
152
|
frame = @framer.read_frame(@local_settings.maximum_frame_size)
|
153
|
+
|
149
154
|
# puts "#{self.class} #{@state} read_frame: class=#{frame.class} stream_id=#{frame.stream_id} flags=#{frame.flags} length=#{frame.length} (remote_stream_id=#{@remote_stream_id})"
|
150
155
|
# puts "Windows: local_window=#{@local_window.inspect}; remote_window=#{@remote_window.inspect}"
|
151
156
|
|
@@ -207,11 +212,21 @@ module Protocol
|
|
207
212
|
end
|
208
213
|
|
209
214
|
def write_frame(frame)
|
210
|
-
|
215
|
+
synchronize do
|
216
|
+
@framer.write_frame(frame)
|
217
|
+
@framer.flush
|
218
|
+
end
|
211
219
|
end
|
212
220
|
|
213
221
|
def write_frames
|
214
|
-
|
222
|
+
if @framer
|
223
|
+
synchronize do
|
224
|
+
yield @framer
|
225
|
+
@framer.flush
|
226
|
+
end
|
227
|
+
else
|
228
|
+
raise EOFError, "Connection closed!"
|
229
|
+
end
|
215
230
|
end
|
216
231
|
|
217
232
|
def update_local_settings(changes)
|
@@ -41,6 +41,10 @@ module Protocol
|
|
41
41
|
@frames = frames
|
42
42
|
end
|
43
43
|
|
44
|
+
def flush
|
45
|
+
@stream.flush
|
46
|
+
end
|
47
|
+
|
44
48
|
def close
|
45
49
|
@stream.close
|
46
50
|
end
|
@@ -69,7 +73,7 @@ module Protocol
|
|
69
73
|
# Read the header:
|
70
74
|
length, type, flags, stream_id = read_header
|
71
75
|
|
72
|
-
#
|
76
|
+
# Console.debug(self) {"read_frame: length=#{length} type=#{type} flags=#{flags} stream_id=#{stream_id} -> klass=#{@frames[type].inspect}"}
|
73
77
|
|
74
78
|
# Allocate the frame:
|
75
79
|
klass = @frames[type] || Frame
|
@@ -78,19 +82,19 @@ module Protocol
|
|
78
82
|
# Read the payload:
|
79
83
|
frame.read(@stream, maximum_frame_size)
|
80
84
|
|
81
|
-
#
|
85
|
+
# Console.debug(self, name: "read") {frame.inspect}
|
82
86
|
|
83
87
|
return frame
|
84
88
|
end
|
85
89
|
|
90
|
+
# Write a frame to the underlying IO.
|
91
|
+
# After writing one or more frames, you should call flush to ensure the frames are sent to the remote peer.
|
92
|
+
# @parameter frame [Frame] the frame to write.
|
86
93
|
def write_frame(frame)
|
87
|
-
#
|
94
|
+
# Console.debug(self, name: "write") {frame.inspect}
|
88
95
|
|
89
96
|
frame.write(@stream)
|
90
97
|
|
91
|
-
# Don't call @stream.flush here because it can cause significant contention if there is a semaphore around this method.
|
92
|
-
# @stream.flush
|
93
|
-
|
94
98
|
return frame
|
95
99
|
end
|
96
100
|
|
@@ -31,7 +31,9 @@ module Protocol
|
|
31
31
|
send_settings(settings)
|
32
32
|
|
33
33
|
read_frame do |frame|
|
34
|
-
|
34
|
+
unless frame.is_a? SettingsFrame
|
35
|
+
raise ProtocolError, "First frame must be #{SettingsFrame}, but got #{frame.class}"
|
36
|
+
end
|
35
37
|
end
|
36
38
|
else
|
37
39
|
raise ProtocolError, "Cannot read connection preface in state #{@state}"
|
data/license.md
CHANGED
data/readme.md
CHANGED
@@ -96,3 +96,11 @@ We welcome contributions to this project.
|
|
96
96
|
3. Commit your changes (`git commit -am 'Add some feature'`).
|
97
97
|
4. Push to the branch (`git push origin my-new-feature`).
|
98
98
|
5. Create new Pull Request.
|
99
|
+
|
100
|
+
### Developer Certificate of Origin
|
101
|
+
|
102
|
+
This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
|
103
|
+
|
104
|
+
### Contributor Covenant
|
105
|
+
|
106
|
+
This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -40,7 +40,7 @@ cert_chain:
|
|
40
40
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
41
41
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
42
42
|
-----END CERTIFICATE-----
|
43
|
-
date:
|
43
|
+
date: 2024-04-21 00:00:00.000000000 Z
|
44
44
|
dependencies:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: protocol-hpack
|
@@ -70,48 +70,6 @@ dependencies:
|
|
70
70
|
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0.18'
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: bundler
|
75
|
-
requirement: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - ">="
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '0'
|
80
|
-
type: :development
|
81
|
-
prerelease: false
|
82
|
-
version_requirements: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '0'
|
87
|
-
- !ruby/object:Gem::Dependency
|
88
|
-
name: covered
|
89
|
-
requirement: !ruby/object:Gem::Requirement
|
90
|
-
requirements:
|
91
|
-
- - ">="
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
type: :development
|
95
|
-
prerelease: false
|
96
|
-
version_requirements: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
98
|
-
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '0'
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: sus
|
103
|
-
requirement: !ruby/object:Gem::Requirement
|
104
|
-
requirements:
|
105
|
-
- - ">="
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version: '0'
|
108
|
-
type: :development
|
109
|
-
prerelease: false
|
110
|
-
version_requirements: !ruby/object:Gem::Requirement
|
111
|
-
requirements:
|
112
|
-
- - ">="
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
version: '0'
|
115
73
|
description:
|
116
74
|
email:
|
117
75
|
executables: []
|
@@ -154,14 +112,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
112
|
requirements:
|
155
113
|
- - ">="
|
156
114
|
- !ruby/object:Gem::Version
|
157
|
-
version: '
|
115
|
+
version: '3.0'
|
158
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
117
|
requirements:
|
160
118
|
- - ">="
|
161
119
|
- !ruby/object:Gem::Version
|
162
120
|
version: '0'
|
163
121
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
122
|
+
rubygems_version: 3.5.3
|
165
123
|
signing_key:
|
166
124
|
specification_version: 4
|
167
125
|
summary: A low level implementation of the HTTP/2 protocol.
|
metadata.gz.sig
CHANGED
Binary file
|