mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-13 00:02:57 -04:00
passing interests call to the underlying io object, which makes it more accurate for the ssl case
This commit is contained in:
parent
83b9c645d1
commit
78ce18027c
@ -180,9 +180,7 @@ module HTTPX
|
||||
if connecting?
|
||||
return :w unless @io
|
||||
|
||||
return :rw if @io.state == :connected
|
||||
|
||||
return :w
|
||||
return @io.interests
|
||||
end
|
||||
|
||||
# if the write buffer is full, we drain it
|
||||
|
@ -62,8 +62,10 @@ module HTTPX
|
||||
@io.connect_nonblock
|
||||
@io.post_connection_check(@hostname) if @ctx.verify_mode != OpenSSL::SSL::VERIFY_NONE
|
||||
transition(:negotiated)
|
||||
rescue ::IO::WaitReadable,
|
||||
::IO::WaitWritable
|
||||
rescue ::IO::WaitReadable
|
||||
@interests = :r
|
||||
rescue ::IO::WaitWritable
|
||||
@interests = :w
|
||||
end
|
||||
|
||||
# :nocov:
|
||||
|
@ -13,6 +13,8 @@ module HTTPX
|
||||
|
||||
attr_reader :state
|
||||
|
||||
attr_reader :interests
|
||||
|
||||
alias_method :host, :ip
|
||||
|
||||
def initialize(origin, addresses, options)
|
||||
@ -22,6 +24,7 @@ module HTTPX
|
||||
@options = Options.new(options)
|
||||
@fallback_protocol = @options.fallback_protocol
|
||||
@port = origin.port
|
||||
@interests = :w
|
||||
if @options.io
|
||||
@io = case @options.io
|
||||
when Hash
|
||||
|
@ -15,6 +15,7 @@ module HTTPX
|
||||
@options = Options.new(options)
|
||||
@path = @options.transport_options[:path]
|
||||
@fallback_protocol = @options.fallback_protocol
|
||||
@interests = :w
|
||||
if @options.io
|
||||
@io = case @options.io
|
||||
when Hash
|
||||
|
Loading…
x
Reference in New Issue
Block a user