http-2 0.9.0 → 0.9.1
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/.rspec +1 -0
- data/lib/http/2/connection.rb +7 -5
- data/lib/http/2/version.rb +1 -1
- data/spec/connection_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60d5e715ae277807ca53b015a14a0e8c7f6676b7
|
4
|
+
data.tar.gz: 17c562bfb62b6db7209962ace7bd698a59fa2c91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8d072f9ac4302506d4770fd48fa153567812b2beaa2e0bc4e1f3d04b0cc7560ebf7bd6bc22335e0465814a08a70cdca9f52546b62ffbc362edea5ecfaf41103
|
7
|
+
data.tar.gz: 950e2e78ff84257d62ddaf9d246b31e68689fd8125ee5fb180d239dbeaabe72d373c5a166353000a27d46f3f41c3924de19fa2287c195f7b75215204ae05e78f
|
data/.rspec
CHANGED
data/lib/http/2/connection.rb
CHANGED
@@ -49,9 +49,6 @@ module HTTP2
|
|
49
49
|
# Connection state (:new, :closed).
|
50
50
|
attr_reader :state
|
51
51
|
|
52
|
-
# Last connection error if connection is aborted.
|
53
|
-
attr_reader :error
|
54
|
-
|
55
52
|
# Size of current connection flow control window (by default, set to
|
56
53
|
# infinity, but is automatically updated on receipt of peer settings).
|
57
54
|
attr_reader :local_window
|
@@ -95,6 +92,8 @@ module HTTP2
|
|
95
92
|
@send_buffer = []
|
96
93
|
@continuation = []
|
97
94
|
@error = nil
|
95
|
+
|
96
|
+
@h2c_upgrade = nil
|
98
97
|
end
|
99
98
|
|
100
99
|
# Allocates new stream for current connection.
|
@@ -656,15 +655,18 @@ module HTTP2
|
|
656
655
|
# permitted to open.
|
657
656
|
stream.once(:active) { @active_stream_count += 1 }
|
658
657
|
stream.once(:close) do
|
659
|
-
@streams.delete id
|
660
658
|
@active_stream_count -= 1
|
661
659
|
|
662
660
|
# Store a reference to the closed stream, such that we can respond
|
663
661
|
# to any in-flight frames while close is registered on both sides.
|
664
662
|
# References to such streams will be purged whenever another stream
|
665
663
|
# is closed, with a minimum of 15s RTT time window.
|
666
|
-
@streams_recently_closed.delete_if { |_, v| (Time.now - v) > 15 }
|
667
664
|
@streams_recently_closed[id] = Time.now
|
665
|
+
to_delete = @streams_recently_closed.select { |_, v| (Time.now - v) > 15 }
|
666
|
+
to_delete.each do |stream_id|
|
667
|
+
@streams.delete stream_id
|
668
|
+
@streams_recently_closed.delete stream_id
|
669
|
+
end
|
668
670
|
end
|
669
671
|
|
670
672
|
stream.on(:promise, &method(:promise)) if self.is_a? Server
|
data/lib/http/2/version.rb
CHANGED
data/spec/connection_spec.rb
CHANGED
@@ -543,6 +543,20 @@ RSpec.describe HTTP2::Connection do
|
|
543
543
|
end.to raise_error(ProtocolError)
|
544
544
|
end
|
545
545
|
|
546
|
+
it 'should not raise an error on frame for a closed stream ID' do
|
547
|
+
srv = Server.new
|
548
|
+
srv << CONNECTION_PREFACE_MAGIC
|
549
|
+
|
550
|
+
stream = srv.new_stream
|
551
|
+
stream.send HEADERS.dup
|
552
|
+
stream.send DATA.dup
|
553
|
+
stream.close
|
554
|
+
|
555
|
+
expect do
|
556
|
+
srv << f.generate(RST_STREAM.dup.merge(stream: stream.id))
|
557
|
+
end.to_not raise_error
|
558
|
+
end
|
559
|
+
|
546
560
|
it 'should send GOAWAY frame on connection error' do
|
547
561
|
stream = @conn.new_stream
|
548
562
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Grigorik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|