removed unreachable code

This commit is contained in:
HoneyryderChuck 2023-12-05 23:20:48 +00:00
parent 1bd7831c85
commit 7842d075ad
4 changed files with 4 additions and 48 deletions

View File

@ -293,27 +293,6 @@ module HTTPX
opts
end
def merge2(other)
raise ArgumentError, "#{other} is not a valid set of options" unless other.respond_to?(:to_hash)
h2 = other.to_hash
return self if h2.empty?
h1 = to_hash
return self if h1 >= h2
merged = h1.merge(h2) do |_k, v1, v2|
if v1.respond_to?(:merge) && v2.respond_to?(:merge)
v1.merge(v2)
else
v2
end
end
self.class.new(merged)
end
def to_hash
instance_variables.each_with_object({}) do |ivar, hs|
hs[ivar[1..-1].to_sym] = instance_variable_get(ivar)

View File

@ -80,9 +80,7 @@ module HTTPX
@parser.upgrade(request, response)
@upgrade_protocol = "h2c"
if request.options.max_concurrent_requests != @options.max_concurrent_requests
@options = @options.merge(max_concurrent_requests: nil)
end
@options = @options.merge(max_concurrent_requests: nil)
prev_parser.requests.each do |req|
req.transition(:idle)

View File

@ -168,12 +168,6 @@ module HTTPX
response
end
def build_altsvc_connection(_, _, _, _, _, options)
return if options.proxy
super
end
def proxy_error?(_request, response)
error = response.error
case error
@ -231,13 +225,6 @@ module HTTPX
end
end
def send(request)
return super unless
@options.proxy && @state != :idle && connecting?
(@proxy_pending ||= []) << request
end
def connecting?
return super unless @options.proxy
@ -279,12 +266,6 @@ module HTTPX
when :idle
transition(:connecting)
when :connected
if @proxy_pending
while (req = @proxy_pending.shift)
send(req)
end
end
transition(:open)
end
end

View File

@ -127,11 +127,9 @@ module HTTPX
return
end
if response.status >= 103
# 103 Early Hints advertises resources in document to browsers.
# not very relevant for an HTTP client, discard.
return
end
# 103 Early Hints advertises resources in document to browsers.
# not very relevant for an HTTP client, discard.
return if response.status >= 103
end
@response = response