protocol-http2 0.12.0 → 0.13.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
- data/README.md +0 -3
- data/examples/http2/request.rb +0 -3
- data/examples/http2/requests.rb +0 -1
- data/lib/protocol/http2/stream.rb +20 -5
- data/lib/protocol/http2/version.rb +1 -1
- metadata +3 -4
- data/Rakefile +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ab10b4b60dee6916f40c2f3d2c291f7358371b76a323527e29dc010a8dd250
|
4
|
+
data.tar.gz: 1a7d0c6e216b4c01ee49bf3052da5bd66cef3891ef1c5c321aa19443d1f3ba07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1963aa287377f7e242a6ac386a2a05c04e8c392b0bedbccd0b1d55a5dc88fb7ac0e26a3b7fb6bededb13ef52d27ee5576c5a9ad8479b8f918abb853e28e3802a
|
7
|
+
data.tar.gz: 60c3428b7b58c20d43e1486bec532d848cc3cc84de4a748c01963ad58ad93b51c0dfac08c999123ca20240f8e6134ce7a45b003265d0b38ceed0cb57fb7a7a06
|
data/README.md
CHANGED
@@ -29,7 +29,6 @@ require 'async'
|
|
29
29
|
require 'async/io/stream'
|
30
30
|
require 'async/http/endpoint'
|
31
31
|
require 'protocol/http2/client'
|
32
|
-
require 'pry'
|
33
32
|
|
34
33
|
Async do
|
35
34
|
endpoint = Async::HTTP::Endpoint.parse("https://www.google.com/search?q=kittens")
|
@@ -83,8 +82,6 @@ Async do
|
|
83
82
|
|
84
83
|
puts "Got #{$count} kittens!"
|
85
84
|
|
86
|
-
binding.pry
|
87
|
-
|
88
85
|
puts "Closing client..."
|
89
86
|
client.close
|
90
87
|
end
|
data/examples/http2/request.rb
CHANGED
@@ -5,7 +5,6 @@ require 'async'
|
|
5
5
|
require 'async/io/stream'
|
6
6
|
require 'async/http/endpoint'
|
7
7
|
require 'protocol/http2/client'
|
8
|
-
require 'pry'
|
9
8
|
|
10
9
|
Async do
|
11
10
|
endpoint = Async::HTTP::Endpoint.parse("https://www.google.com/search?q=kittens")
|
@@ -59,8 +58,6 @@ Async do
|
|
59
58
|
|
60
59
|
puts "Got #{$count} kittens!"
|
61
60
|
|
62
|
-
binding.pry
|
63
|
-
|
64
61
|
puts "Closing client..."
|
65
62
|
client.close
|
66
63
|
end
|
data/examples/http2/requests.rb
CHANGED
@@ -124,10 +124,6 @@ module Protocol
|
|
124
124
|
@dependency.parent = stream.dependency
|
125
125
|
end
|
126
126
|
|
127
|
-
# The stream is being closed because the connection is being closed.
|
128
|
-
def close(error = nil)
|
129
|
-
end
|
130
|
-
|
131
127
|
def maximum_frame_size
|
132
128
|
@connection.available_frame_size
|
133
129
|
end
|
@@ -144,6 +140,15 @@ module Protocol
|
|
144
140
|
@state == :closed
|
145
141
|
end
|
146
142
|
|
143
|
+
# Transition directly to closed state. Do not pass go, do not collect $200.
|
144
|
+
# This method should only be used by `Connection#close`.
|
145
|
+
def close(error = nil)
|
146
|
+
unless closed?
|
147
|
+
@state = :closed
|
148
|
+
self.closed(error)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
147
152
|
def send_headers?
|
148
153
|
@state == :idle or @state == :reserved_local or @state == :open or @state == :half_closed_remote
|
149
154
|
end
|
@@ -228,6 +233,10 @@ module Protocol
|
|
228
233
|
end
|
229
234
|
end
|
230
235
|
|
236
|
+
# The stream has been opened.
|
237
|
+
def opened(error = nil)
|
238
|
+
end
|
239
|
+
|
231
240
|
def open!
|
232
241
|
if @state == :idle
|
233
242
|
@state = :open
|
@@ -235,9 +244,15 @@ module Protocol
|
|
235
244
|
raise ProtocolError, "Cannot open stream in state: #{@state}"
|
236
245
|
end
|
237
246
|
|
247
|
+
self.opened
|
248
|
+
|
238
249
|
return self
|
239
250
|
end
|
240
251
|
|
252
|
+
# The stream has been closed. If closed due to a stream reset, the error will be set.
|
253
|
+
def closed(error = nil)
|
254
|
+
end
|
255
|
+
|
241
256
|
# Transition the stream into the closed state.
|
242
257
|
# @param error_code [Integer] the error code if the stream was closed due to a stream reset.
|
243
258
|
def close!(error_code = nil)
|
@@ -248,7 +263,7 @@ module Protocol
|
|
248
263
|
error = StreamError.new("Stream closed!", error_code)
|
249
264
|
end
|
250
265
|
|
251
|
-
self.
|
266
|
+
self.closed(error)
|
252
267
|
|
253
268
|
return self
|
254
269
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: protocol-hpack
|
@@ -106,7 +106,6 @@ files:
|
|
106
106
|
- ".travis.yml"
|
107
107
|
- Gemfile
|
108
108
|
- README.md
|
109
|
-
- Rakefile
|
110
109
|
- examples/http2/request.rb
|
111
110
|
- examples/http2/requests.rb
|
112
111
|
- lib/protocol/http2.rb
|
@@ -151,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
150
|
- !ruby/object:Gem::Version
|
152
151
|
version: '0'
|
153
152
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.0.6
|
155
154
|
signing_key:
|
156
155
|
specification_version: 4
|
157
156
|
summary: A low level implementation of the HTTP/2 protocol.
|