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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d1bbb7eb0d7324fb63a671d0f8fbc2075b6a625
4
- data.tar.gz: 9d4dd0e9e5131ac605292030235b9a68a8087b83
3
+ metadata.gz: 18710a965a164e5bea9b9908f5dd2781a9127f82
4
+ data.tar.gz: 18d688b4bfcd348425a25b3ae28799e43dcf0797
5
5
  SHA512:
6
- metadata.gz: 1db0898b540554278ee5a3789bafae4aac29e9a8075fdfbd26c0aca57f360136b9c3c4c60f57b0ff412030ad87c2878b5890f4e9df255535a73ddf7535609ef4
7
- data.tar.gz: 064cdc09d94dbd1e13623ae2a42b5cb5f695344f83ed60faadfab7aa1e9f7c721099e8fc8187133f9cbb36523f89142a1672c6071b8bf937b9ca342c954d4ada
6
+ metadata.gz: dd13a8cf03e120ce63c6a026700efc0778bdc8dd5267e2058cde9bebc70b8c614c7754fff454c9732f95d264e9c55d63fcca931aea3f61303652c21929ba3dd5
7
+ data.tar.gz: b8af38fa0eb0c5dd910de7df56562e5e3f36f401ee71f88bef5ad7da72e4626a7add423920462bcdf43cbfe065073316e479096ae45eb5d192d62cae59925f21
data/.travis.yml CHANGED
@@ -1,9 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1
4
3
  - 2.2
5
- - 2.3.0
6
- - 2.3.1
4
+ - 2.3.3
5
+ - 2.4.0
7
6
 
8
7
  branches:
9
8
  only:
data/lib/net-http2.rb CHANGED
@@ -6,8 +6,6 @@ require 'net-http2/socket'
6
6
  require 'net-http2/stream'
7
7
  require 'net-http2/version'
8
8
 
9
- require 'http2_patch'
10
-
11
9
  module NetHttp2
12
10
  raise "Cannot require NetHttp2, unsupported engine '#{RUBY_ENGINE}'" unless RUBY_ENGINE == "ruby"
13
11
  end
@@ -60,6 +60,14 @@ module NetHttp2
60
60
  end
61
61
  end
62
62
 
63
+ def remote_settings
64
+ h2.remote_settings
65
+ end
66
+
67
+ def stream_count
68
+ @streams.length
69
+ end
70
+
63
71
  private
64
72
 
65
73
  def init_vars
@@ -1,3 +1,3 @@
1
1
  module NetHttp2
2
- VERSION = '0.15.0'.freeze
2
+ VERSION = '0.16.0'.freeze
3
3
  end
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.2"
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.15.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-02-28 00:00:00.000000000 Z
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.2
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.2
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