mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
A subtle bug slipped through the cracks, where if a resolve timeout error happened, the connection would remain in the pool. Subsequent requests to the same domain would activate it, although no requests would go through it; the actual desired behaviour is to outright remove it from the pool on such errors. This was achieved by registering the "unregister_connection" callback earlier. However, the connection accounting step would only trigger if taking it out of the selector worked, meaning it had been registered before.
23 lines
600 B
Plaintext
23 lines
600 B
Plaintext
module HTTPX
|
|
class Selector
|
|
type selectable = Connection | Resolver::Native | Resolver::System
|
|
|
|
READABLE: Array[Symbol]
|
|
WRITABLE: Array[Symbol]
|
|
@selectables: Array[selectable]
|
|
|
|
def register: (selectable io) -> void
|
|
def deregister: (selectable io) -> selectable?
|
|
|
|
def select: (Numeric? interval) { (selectable) -> void } -> void
|
|
|
|
private
|
|
|
|
def initialize: () -> untyped
|
|
|
|
def select_many: (Numeric? interval) { (selectable) -> void } -> void
|
|
def select_one: (Numeric? interval) { (selectable) -> void } -> void
|
|
end
|
|
|
|
type io_interests = :r | :w | :rw
|
|
end |