class Net::HTTP::ConnectionPool::Session

@private

def finish

Returns:
  • (nil) -
def finish
  begin
    http_session.finish if http_session.started?
  rescue IOError
  end
  nil
end

def for connection, open_timeout, debug_logger = nil

def for connection, open_timeout, debug_logger = nil
  http_args = []
  http_args << connection.host
  http_args << connection.port
  if connection.proxy?
    http_args << connection.proxy_address
    http_args << connection.proxy_port
    http_args << connection.proxy_user
    http_args << connection.proxy_password
  end
  http = Net::HTTP.new(*http_args)
  http.set_debug_output(debug_logger)
  http.open_timeout = open_timeout
  if connection.ssl?
    http.use_ssl = true
    if connection.ssl_verify_peer?
      http.verify_mode = OpenSSL::SSL::VERIFY_PEER
      http.ca_file = connection.ssl_ca_file if connection.ssl_ca_file
      http.ca_path = connection.ssl_ca_path if connection.ssl_ca_path
    else
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    end
  else
    http.use_ssl = false
  end
  http.start
  Session.new(http, connection.key)
end

def initialize http_session, key

def initialize http_session, key
  @http_session = http_session
  @key = key
  @created_at = Time.now
  @last_used_at = nil
end

def request *args, &block

def request *args, &block
  response = http_session.request(*args, &block)
  @last_used_at = Time.now
  response
end