connection emits the exhausted event when the strem limit has been achieved on an HTTP/2 connection

this happens when the requests are enqueued before the connection is
negotiated, and then one has too many requests enqueued.
This commit is contained in:
HoneyryderChuck 2020-03-07 00:29:40 +00:00
parent 1ad91d898e
commit a4c0096cd8
2 changed files with 6 additions and 0 deletions

View File

@ -292,6 +292,9 @@ module HTTPX
parser.on(:promise) do |request, stream|
request.emit(:promise, parser, stream)
end
parser.on(:exhausted) do
emit(:exhausted)
end
parser.on(:origin) do |origin|
@origins << origin
end

View File

@ -56,6 +56,9 @@ module HTTPX
end
handle(request, stream)
true
rescue HTTP2Next::Error::StreamLimitExceeded
@pending.unshift(request)
emit(:exhausted)
end
def consume