http-2-next 0.2.5 → 0.2.6

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: a4bc850ae42e15d3e2bebfa09e18223b29c0165ac5a6d4fcf5f3249c200319ba
4
- data.tar.gz: 802fefcc76aa95b7bbf3893b750d018953466780d1efc22f25e10d644214c2ef
3
+ metadata.gz: ba5613efe08f91c20db5d9c32fbbac18a2d6f214ba42037c341dd9b40cbffe23
4
+ data.tar.gz: c7e0f3a0256a2cf7d106c1be72417c863e37f4c203bc7df6910ff91d135479e6
5
5
  SHA512:
6
- metadata.gz: bc1ce68818a4f93e93744834e76ec701c99adabce55f5045f7c1caa3969e8586e681c4f77355138cb05c3e4f6c5eb036ce26d3582b0ca3ce80a14ab99cd1d0dd
7
- data.tar.gz: 855c24d7a79eb56808ae0993b23a5115ff3f19889da8be5ebb1db8354ed138c5728047d9416cc48ff3b8a27577b551a357b1a4aa1e7cbda107e5c977a868b351
6
+ metadata.gz: 645582d2208c23b84120256893828f8fc5f3c7d058848979fd62188a9fd31746aafade3759334d06ae8d53b2ee6ab3bff23d4eb5288112da31ccf6dee8a187cf
7
+ data.tar.gz: 3804926e00e854b61a25dbf0e515ae5fcfb82532403909f6d3e4e035f7ebeef162c14bc00d64babd0013cdb22f2a7164f02dc708d1575392fc8b3445ddd953f6
@@ -72,6 +72,9 @@ module HTTP2Next
72
72
  # are not counted towards the stream limit).
73
73
  attr_reader :active_stream_count
74
74
 
75
+ # Max number of streams that can be in-transit in this connection.
76
+ attr_writer :max_streams
77
+
75
78
  # Initializes new connection object.
76
79
  #
77
80
  def initialize(settings = {})
@@ -82,6 +85,7 @@ module HTTP2Next
82
85
  @decompressor = Header::Decompressor.new(settings)
83
86
 
84
87
  @active_stream_count = 0
88
+ @max_streams = nil
85
89
  @last_activated_stream = 0
86
90
  @last_stream_id = 0
87
91
  @streams = {}
@@ -114,7 +118,7 @@ module HTTP2Next
114
118
  # @param parent [Stream]
115
119
  def new_stream(**args)
116
120
  raise ConnectionClosed if @state == :closed
117
- raise StreamLimitExceeded if @active_stream_count >= @remote_settings[:settings_max_concurrent_streams]
121
+ raise StreamLimitExceeded if @active_stream_count >= (@max_streams || @remote_settings[:settings_max_concurrent_streams])
118
122
 
119
123
  connection_error(:protocol_error, msg: "id is smaller than previous") if @stream_id < @last_activated_stream
120
124
 
@@ -706,7 +710,7 @@ module HTTP2Next
706
710
  def activate_stream(id: nil, **args)
707
711
  connection_error(msg: "Stream ID already exists") if @streams.key?(id)
708
712
 
709
- raise StreamLimitExceeded if @active_stream_count >= @local_settings[:settings_max_concurrent_streams]
713
+ raise StreamLimitExceeded if @active_stream_count >= (@max_streams || @local_settings[:settings_max_concurrent_streams])
710
714
 
711
715
  stream = Stream.new(connection: self, id: id, **args)
712
716
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTP2Next
4
- VERSION = "0.2.5"
4
+ VERSION = "0.2.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-2-next
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-03-09 00:00:00.000000000 Z
13
+ date: 2020-03-15 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Pure-ruby HTTP 2.0 protocol implementation
16
16
  email: