From e30469f8a39abac3cecf1f68fdd7db7199e1cbfd Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Sat, 30 Nov 2019 14:59:18 +0000 Subject: [PATCH] fixing usage of active_stream_count, which changed in http-2-next, and never decrements; using local active stream count instead --- lib/httpx/connection/http2.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/httpx/connection/http2.rb b/lib/httpx/connection/http2.rb index 0da2c1ab..11318f26 100644 --- a/lib/httpx/connection/http2.rb +++ b/lib/httpx/connection/http2.rb @@ -41,7 +41,7 @@ module HTTPX def send(request, **) if !@handshake_completed || - @connection.active_stream_count >= @max_concurrent_requests + @streams.size >= @max_concurrent_requests @pending << request return end @@ -224,7 +224,7 @@ module HTTPX emit(:error, request, ex) end end - return unless @connection.state == :closed && @connection.active_stream_count.zero? + return unless @connection.state == :closed && @streams.size.zero? emit(:close) end