mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
re-set the http2 max streams on settings negotiation.
there was a bug where the max streams in the connection would trigger a stream limit exceeded, however the check done was based on active streams that max requests variable from the httpx connection. This is wrong when peer negotiates more concurrent streams, but is checking the stream limit against the wrong value received from httpx.
This commit is contained in:
parent
fef2d78382
commit
79d71dcc92
@ -43,6 +43,8 @@ module HTTPX
|
||||
end
|
||||
|
||||
def exhausted?
|
||||
return false if @max_requests.zero? && @connection.active_stream_count.zero?
|
||||
|
||||
@connection.active_stream_count >= @max_requests
|
||||
end
|
||||
|
||||
@ -228,7 +230,11 @@ module HTTPX
|
||||
def on_settings(*)
|
||||
@handshake_completed = true
|
||||
|
||||
@max_requests = @connection.remote_settings[:settings_max_concurrent_streams] if @max_requests.zero?
|
||||
if @max_requests.zero?
|
||||
@max_requests = @connection.remote_settings[:settings_max_concurrent_streams]
|
||||
|
||||
@connection.max_streams = @max_requests if @connection.respond_to?(:max_streams=) && @max_requests.positive?
|
||||
end
|
||||
|
||||
@max_concurrent_requests = [@max_concurrent_requests, @max_requests].min
|
||||
send_pending
|
||||
|
Loading…
x
Reference in New Issue
Block a user