eden connections should only reset to idle once they are picked up

This commit is contained in:
HoneyryderChuck 2023-11-05 10:57:04 +00:00
parent f442e81414
commit bea2c4d5c6
2 changed files with 3 additions and 5 deletions

View File

@ -90,7 +90,7 @@ module HTTPX
end
def match?(uri, options)
return false if @state == :closing || @state == :closed
return false if !used? && (@state == :closing || @state == :closed)
return false if exhausted?

View File

@ -110,6 +110,7 @@ module HTTPX
end
if conn
conn.idling
@connections << conn
select_connection(conn)
end
@ -227,10 +228,7 @@ module HTTPX
def unregister_connection(connection)
@connections.delete(connection)
if connection.used? && !@eden_connections.include?(connection)
@eden_connections << connection
connection.idling
end
@eden_connections << connection if connection.used? && !@eden_connections.include?(connection)
@connected_connections -= 1 if deselect_connection(connection)
end