protocol-http2 0.5.1 → 0.5.2

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
  SHA256:
3
- metadata.gz: '059852cf900073a0e3912ecaecb404c6dc03399171ba1d8d652c94d5c2d05bcb'
4
- data.tar.gz: af70c37e08a40cb9ad29405bfa2fedcb35883a5cc198514c0f4b9b2bd9e8d16f
3
+ metadata.gz: 868932fdb503f3fb6cc3fed243af7019b56e24bb1ac56a42e69132e0dad1af41
4
+ data.tar.gz: fb965bc65c34b0ad14f10985c0f21676e1b9a9ceab1052d7482635d5542f461b
5
5
  SHA512:
6
- metadata.gz: f037c46422f893916eefc69166f38f2f4438648b763cf6326e8fc2ee2d6da8d97eeb7eeb0ff1609d126ae94b2d79312bad11c10f5ae9d42db73b236847af9649
7
- data.tar.gz: abc5da3f1ebf160d3427641c5040efad5dd29b5316bf619a5dbae6e66e598e3cd7847517ef4519a9987f889219284e7ee9c7e8b6c96977e6fbe988ebef37b6e5
6
+ metadata.gz: d3f8197a22080d609c376e48fd4019aa751b9cf2b845c7d5c9d5f3917e349a09a3ea14d256cac36e815d7126ad72c95a268f754884db200eed006e2f6400d450
7
+ data.tar.gz: a9cf712bc5eee80c7d77f3628e7df163b3c253a5910358534d52910f13064b5c197ca815eb248483be429544f2cff0af0ce8a540172143eb44bea2f53223a6f3
@@ -31,6 +31,7 @@ module Protocol
31
31
  def initialize(framer, local_stream_id)
32
32
  @state = :new
33
33
  @streams = {}
34
+ @closed = 0
34
35
 
35
36
  @framer = framer
36
37
  @local_stream_id = local_stream_id
@@ -79,6 +80,14 @@ module Protocol
79
80
  @state == :closed
80
81
  end
81
82
 
83
+ def stream_closed(stream)
84
+ @closed += 1
85
+ end
86
+
87
+ def active_stream_count
88
+ @streams.size - @closed
89
+ end
90
+
82
91
  def connection_error!(error, message)
83
92
  return if @framer.closed?
84
93
 
@@ -327,7 +336,7 @@ module Protocol
327
336
  if stream = @streams[frame.stream_id]
328
337
  stream.receive_headers(frame)
329
338
  else
330
- if @streams.count < self.maximum_concurrent_streams
339
+ if self.active_stream_count < self.maximum_concurrent_streams
331
340
  stream = accept_stream(frame.stream_id)
332
341
  stream.receive_headers(frame)
333
342
  else
@@ -220,6 +220,8 @@ module Protocol
220
220
  # This is not the same as a `close` method. If you are looking for that, use `send_stream_reset`.
221
221
  def close!
222
222
  @state = :closed
223
+
224
+ @connection.stream_closed(self)
223
225
  end
224
226
 
225
227
  def send_reset_stream(error_code = 0)
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Protocol
22
22
  module HTTP2
23
- VERSION = "0.5.1"
23
+ VERSION = "0.5.2"
24
24
  end
25
25
  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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-12 00:00:00.000000000 Z
11
+ date: 2019-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: protocol-hpack