class HTTPClient::Session
def query(req)
def query(req) connect if @state == :INIT # Use absolute URI (not absolute path) iif via proxy AND not HTTPS. req.header.request_absolute_uri = !@proxy.nil? && !https?(@dest) begin timeout(@send_timeout, SendTimeoutError) do set_header(req) req.dump(@socket) # flush the IO stream as IO::sync mode is false @socket.flush unless @socket_sync end rescue Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EPIPE, IOError # JRuby can raise IOError instead of ECONNRESET for now close raise KeepAliveDisconnected.new(self, $!) rescue HTTPClient::TimeoutError close raise rescue => e close if SSLEnabled and e.is_a?(OpenSSL::SSL::SSLError) raise KeepAliveDisconnected.new(self, e) else raise end end @state = :META if @state == :WAIT @next_connection = nil @requests.push(req) @last_used = Time.now end