mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
call #consume in a specific close_handshake instead
This commit is contained in:
parent
1907a00d19
commit
a49fcc65f5
@ -422,6 +422,9 @@ module HTTPX
|
||||
emit(:close)
|
||||
end
|
||||
end
|
||||
parser.on(:close_handshake) do
|
||||
consume
|
||||
end
|
||||
parser.on(:reset) do
|
||||
if parser.empty?
|
||||
reset
|
||||
@ -471,6 +474,7 @@ module HTTPX
|
||||
emit(:open)
|
||||
when :closing
|
||||
return unless @state == :open
|
||||
|
||||
when :closed
|
||||
return unless @state == :closing
|
||||
return unless @write_buffer.empty?
|
||||
|
@ -123,8 +123,9 @@ module HTTPX
|
||||
end
|
||||
|
||||
def handle_error(ex)
|
||||
if ex.instance_of?(TimeoutError) && !@handshake_completed
|
||||
if ex.instance_of?(TimeoutError) && !@handshake_completed && @connection.state != :closed
|
||||
@connection.goaway(:settings_timeout, "closing due to settings timeout")
|
||||
emit(:close_handshake)
|
||||
settings_ex = SettingsTimeoutError.new(ex.timeout, ex.message)
|
||||
settings_ex.set_backtrace(ex.backtrace)
|
||||
ex = settings_ex
|
||||
|
Loading…
x
Reference in New Issue
Block a user