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 +4 -4
- data/lib/http/2/next/connection.rb +6 -2
- data/lib/http/2/next/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba5613efe08f91c20db5d9c32fbbac18a2d6f214ba42037c341dd9b40cbffe23
|
4
|
+
data.tar.gz: c7e0f3a0256a2cf7d106c1be72417c863e37f4c203bc7df6910ff91d135479e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/http/2/next/version.rb
CHANGED
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.
|
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-
|
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:
|