net-http2 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/lib/net-http2.rb +0 -2
- data/lib/net-http2/client.rb +8 -0
- data/lib/net-http2/version.rb +1 -1
- data/net-http2.gemspec +1 -1
- metadata +4 -5
- data/lib/http2_patch.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18710a965a164e5bea9b9908f5dd2781a9127f82
|
4
|
+
data.tar.gz: 18d688b4bfcd348425a25b3ae28799e43dcf0797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd13a8cf03e120ce63c6a026700efc0778bdc8dd5267e2058cde9bebc70b8c614c7754fff454c9732f95d264e9c55d63fcca931aea3f61303652c21929ba3dd5
|
7
|
+
data.tar.gz: b8af38fa0eb0c5dd910de7df56562e5e3f36f401ee71f88bef5ad7da72e4626a7add423920462bcdf43cbfe065073316e479096ae45eb5d192d62cae59925f21
|
data/.travis.yml
CHANGED
data/lib/net-http2.rb
CHANGED
data/lib/net-http2/client.rb
CHANGED
data/lib/net-http2/version.rb
CHANGED
data/net-http2.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "http-2", "0.8.
|
22
|
+
spec.add_dependency "http-2", "0.8.4"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-http2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Ostinelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.8.
|
19
|
+
version: 0.8.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.8.
|
26
|
+
version: 0.8.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,7 +84,6 @@ files:
|
|
84
84
|
- Rakefile
|
85
85
|
- bin/console
|
86
86
|
- bin/setup
|
87
|
-
- lib/http2_patch.rb
|
88
87
|
- lib/net-http2.rb
|
89
88
|
- lib/net-http2/callbacks.rb
|
90
89
|
- lib/net-http2/client.rb
|
data/lib/http2_patch.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'http/2/connection'
|
2
|
-
|
3
|
-
# We are currently locked to using the Http2 library v0.8.2 since v0.8.3 still has some compatibility issues:
|
4
|
-
# <https://github.com/igrigorik/http-2/issues/92>
|
5
|
-
#
|
6
|
-
# However, v0.8.2 had a memory leak that was reported in the following issues:
|
7
|
-
# <https://github.com/igrigorik/http-2/issues/73>
|
8
|
-
# <https://github.com/ostinelli/net-http2/issues/7>
|
9
|
-
#
|
10
|
-
# Hence, this is a temporary monkey-patch to the HTTP2 library in order to solve the mentioned leak
|
11
|
-
# while waiting to fix the issues on v0.8.3.
|
12
|
-
|
13
|
-
module HTTP2
|
14
|
-
|
15
|
-
class Connection
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def activate_stream(id: nil, **args)
|
20
|
-
connection_error(msg: 'Stream ID already exists') if @streams.key?(id)
|
21
|
-
|
22
|
-
stream = Stream.new({ connection: self, id: id }.merge(args))
|
23
|
-
|
24
|
-
# Streams that are in the "open" state, or either of the "half closed"
|
25
|
-
# states count toward the maximum number of streams that an endpoint is
|
26
|
-
# permitted to open.
|
27
|
-
stream.once(:active) { @active_stream_count += 1 }
|
28
|
-
|
29
|
-
@streams_recently_closed ||= {}
|
30
|
-
stream.once(:close) do
|
31
|
-
@active_stream_count -= 1
|
32
|
-
|
33
|
-
@streams_recently_closed.delete_if do |closed_stream_id, v|
|
34
|
-
to_be_deleted = (Time.now - v) > 15
|
35
|
-
@streams.delete(closed_stream_id) if to_be_deleted
|
36
|
-
to_be_deleted
|
37
|
-
end
|
38
|
-
|
39
|
-
@streams_recently_closed[id] = Time.now
|
40
|
-
end
|
41
|
-
|
42
|
-
stream.on(:promise, &method(:promise)) if self.is_a? Server
|
43
|
-
stream.on(:frame, &method(:send))
|
44
|
-
stream.on(:window_update, &method(:window_update))
|
45
|
-
|
46
|
-
@streams[id] = stream
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|