mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
removed .expired? dead code functions
not used anywhere. also, initialized an ivar in ssl class
This commit is contained in:
parent
b1be71bb7f
commit
2897179c44
@ -139,12 +139,6 @@ module HTTPX
|
||||
) && @options == options
|
||||
end
|
||||
|
||||
def expired?
|
||||
return false unless @io
|
||||
|
||||
@io.expired?
|
||||
end
|
||||
|
||||
def mergeable?(connection)
|
||||
return false if @state == :closing || @state == :closed || !@io
|
||||
|
||||
|
@ -19,6 +19,7 @@ module HTTPX
|
||||
def initialize(_, _, options)
|
||||
super
|
||||
|
||||
@ssl_session = nil
|
||||
ctx_options = TLS_OPTIONS.merge(options.ssl)
|
||||
@sni_hostname = ctx_options.delete(:hostname) || @hostname
|
||||
|
||||
@ -84,10 +85,6 @@ module HTTPX
|
||||
@state == :negotiated
|
||||
end
|
||||
|
||||
def expired?
|
||||
super || ssl_session_expired?
|
||||
end
|
||||
|
||||
def ssl_session_expired?
|
||||
@ssl_session.nil? || Process.clock_gettime(Process::CLOCK_REALTIME) >= (@ssl_session.time.to_f + @ssl_session.timeout)
|
||||
end
|
||||
|
@ -174,17 +174,6 @@ module HTTPX
|
||||
@state == :idle || @state == :closed
|
||||
end
|
||||
|
||||
def expired?
|
||||
# do not mess with external sockets
|
||||
return false if @options.io
|
||||
|
||||
return true if @addresses.empty?
|
||||
|
||||
resolver_addresses = Resolver.nolookup_resolve(@hostname)
|
||||
|
||||
(Array(resolver_addresses) & @addresses).empty?
|
||||
end
|
||||
|
||||
# :nocov:
|
||||
def inspect
|
||||
"#<#{self.class}:#{object_id} " \
|
||||
|
@ -56,10 +56,6 @@ module HTTPX
|
||||
true
|
||||
end
|
||||
|
||||
def expired?
|
||||
false
|
||||
end
|
||||
|
||||
# :nocov:
|
||||
def inspect
|
||||
"#<#{self.class}:#{object_id} @path=#{@path}) @state=#{@state})>"
|
||||
|
@ -62,8 +62,6 @@ module HTTPX
|
||||
|
||||
def match?: (URI::Generic uri, Options options) -> bool
|
||||
|
||||
def expired?: () -> boolish
|
||||
|
||||
def mergeable?: (Connection connection) -> bool
|
||||
|
||||
def coalesce!: (instance connection) -> void
|
||||
|
@ -54,8 +54,6 @@ module HTTPX
|
||||
|
||||
def connected?: () -> bool
|
||||
|
||||
def expired?: () -> boolish
|
||||
|
||||
def closed?: () -> bool
|
||||
|
||||
# :nocov:
|
||||
|
@ -19,7 +19,6 @@ module HTTPX
|
||||
|
||||
def connect: () -> void
|
||||
|
||||
def expired?: () -> bool
|
||||
private
|
||||
|
||||
def build_socket: () -> Socket
|
||||
|
Loading…
x
Reference in New Issue
Block a user