fix for Connection too many object shapes

some more ivars which were not initialized in the first place were leading to the warning in CI mode
This commit is contained in:
HoneyryderChuck 2025-07-14 11:40:14 +01:00
parent f64c3ab599
commit d64f247e11
2 changed files with 13 additions and 4 deletions

View File

@ -50,7 +50,11 @@ module HTTPX
protected :sibling
def initialize(uri, options)
@current_session = @current_selector = @sibling = @coalesced_connection = nil
@current_session = @current_selector =
@parser = @sibling = @coalesced_connection =
@io = @ssl_session = @timeout =
@connected_at = @response_received_at = nil
@exhausted = @cloned = @main_sibling = false
@options = Options.new(options)
@ -61,6 +65,8 @@ module HTTPX
@read_buffer = Buffer.new(@options.buffer_size)
@write_buffer = Buffer.new(@options.buffer_size)
@pending = []
@inflight = 0
@keep_alive_timeout = @options.timeout[:keep_alive_timeout]
on(:error, &method(:on_error))
if @options.io
@ -98,9 +104,6 @@ module HTTPX
build_altsvc_connection(alt_origin, origin, alt_params)
end
@inflight = 0
@keep_alive_timeout = @options.timeout[:keep_alive_timeout]
self.addresses = @options.addresses if @options.addresses
end

View File

@ -65,6 +65,12 @@ module HTTPX
module ConnectionMethods
attr_reader :upgrade_protocol, :hijacked
def initialize(*)
super
@upgrade_protocol = nil
end
def hijack_io
@hijacked = true