fixing downgrade of MAX_CONCURRENT_STREAMS

in a situation where this was set by default to 200, and when receiving
settings with a lower value (let's say, 100), the connection didn't know
what to do with the remaining 100, and this was left hanging; now, it
signalizes the session that we need an extra connection, and this will
pick up the remaining and establish a new connection.
This commit is contained in:
HoneyryderChuck 2020-03-14 22:26:38 +00:00
parent 885df66067
commit ee946d3d2c
2 changed files with 5 additions and 1 deletions

View File

@ -211,6 +211,7 @@ module HTTPX
close
emit(:close)
emit(:exhausted) unless @pending.empty?
end
def on_frame(bytes)

View File

@ -78,7 +78,10 @@ module HTTPX
connection.on(:exhausted) do
other_connection = connection.create_idle
other_connection.merge(connection)
pool.init_connection(other_connection, options)
catch(:coalesced) do
pool.init_connection(other_connection, options)
end
set_connection_callbacks(other_connection, connections, options)
connections << other_connection
end
end