mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
do not try to cast to Options all the time, trust the internal structure
This commit is contained in:
parent
dcbd2f81e3
commit
b686119a6f
@ -48,6 +48,8 @@ module HTTPX
|
||||
attr_accessor :family
|
||||
|
||||
def initialize(uri, options)
|
||||
@origins = [uri.origin]
|
||||
@origin = Utils.to_uri(uri.origin)
|
||||
@options = Options.new(options)
|
||||
@type = initialize_type(uri, @options)
|
||||
@origins = [uri.origin]
|
||||
|
@ -15,7 +15,7 @@ module HTTPX
|
||||
attr_accessor :max_concurrent_requests
|
||||
|
||||
def initialize(buffer, options)
|
||||
@options = Options.new(options)
|
||||
@options = options
|
||||
@max_concurrent_requests = @options.max_concurrent_requests || MAX_REQUESTS
|
||||
@max_requests = @options.max_requests
|
||||
@parser = Parser::HTTP1.new(self)
|
||||
|
@ -25,7 +25,7 @@ module HTTPX
|
||||
attr_reader :streams, :pending
|
||||
|
||||
def initialize(buffer, options)
|
||||
@options = Options.new(options)
|
||||
@options = options
|
||||
@settings = @options.http2_settings
|
||||
@pending = []
|
||||
@streams = {}
|
||||
|
@ -17,7 +17,7 @@ module HTTPX
|
||||
@state = :idle
|
||||
@addresses = []
|
||||
@hostname = origin.host
|
||||
@options = Options.new(options)
|
||||
@options = options
|
||||
@fallback_protocol = @options.fallback_protocol
|
||||
@port = origin.port
|
||||
@interests = :w
|
||||
|
@ -12,7 +12,7 @@ module HTTPX
|
||||
@addresses = []
|
||||
@hostname = origin.host
|
||||
@state = :idle
|
||||
@options = Options.new(options)
|
||||
@options = options
|
||||
@fallback_protocol = @options.fallback_protocol
|
||||
if @options.io
|
||||
@io = case @options.io
|
||||
|
@ -89,7 +89,7 @@ module HTTPX
|
||||
|
||||
def initialize(buffer, options)
|
||||
@buffer = buffer
|
||||
@options = Options.new(options)
|
||||
@options = options
|
||||
end
|
||||
|
||||
def close; end
|
||||
|
@ -141,7 +141,7 @@ module HTTPX
|
||||
|
||||
def initialize(buffer, options)
|
||||
@buffer = buffer
|
||||
@options = Options.new(options)
|
||||
@options = options
|
||||
end
|
||||
|
||||
def close; end
|
||||
|
@ -33,7 +33,7 @@ module HTTPX
|
||||
def initialize(family, options)
|
||||
@family = family
|
||||
@record_type = RECORD_TYPES[family]
|
||||
@options = Options.new(options)
|
||||
@options = options
|
||||
end
|
||||
|
||||
def close; end
|
||||
|
@ -251,7 +251,7 @@ module HTTPX
|
||||
@request = request
|
||||
@response = request.response if request.response.is_a?(Response)
|
||||
@error = error
|
||||
@options = Options.new(options)
|
||||
@options = options
|
||||
log_exception(@error)
|
||||
end
|
||||
|
||||
|
@ -93,9 +93,9 @@ module HTTPX
|
||||
|
||||
private
|
||||
|
||||
def initialize: (http_uri uri, options) -> void
|
||||
def initialize: (http_uri uri, Options options) -> void
|
||||
|
||||
def initialize_type: (http_uri uri, Options) -> io_type
|
||||
def initialize_type: (http_uri uri, Options options) -> io_type
|
||||
|
||||
def connect: () -> void
|
||||
|
||||
|
@ -58,7 +58,7 @@ module HTTPX
|
||||
|
||||
private
|
||||
|
||||
def initialize: (Buffer, options) -> untyped
|
||||
def initialize: (Buffer buffer, Options options) -> untyped
|
||||
|
||||
def manage_connection: (Request request, Response response) -> void
|
||||
|
||||
|
@ -42,7 +42,7 @@ module HTTPX
|
||||
|
||||
private
|
||||
|
||||
def initialize: (Buffer, options) -> untyped
|
||||
def initialize: (Buffer buffer, Options options) -> untyped
|
||||
|
||||
def send_pending: () -> void
|
||||
|
||||
|
@ -15,7 +15,7 @@ module HTTPX
|
||||
|
||||
@io: Socket
|
||||
|
||||
def initialize: (http_uri origin, String? path, options options) -> void
|
||||
def initialize: (http_uri origin, String? path, Options options) -> void
|
||||
|
||||
def connect: () -> void
|
||||
|
||||
|
@ -26,7 +26,7 @@ module HTTPX
|
||||
|
||||
def emit_resolved_connection: (Connection connection, Array[IPAddr] addresses, bool early_resolve) -> void
|
||||
|
||||
def initialize: (ip_family? family, options options) -> void
|
||||
def initialize: (ip_family? family, Options options) -> void
|
||||
|
||||
def early_resolve: (Connection connection, ?hostname: String) -> void
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user