Sha256: 0b16f50b90f4e8a2d067e8353f69df81e215e80cdef5278e1fdf0f8589fd96e0

Contents?: true

Size: 716 Bytes

Versions: 56

Compression:

Stored size: 716 Bytes

Contents

##
# A Gem::Net::HTTP connection wrapper that holds extra information for managing the
# connection's lifetime.

class Gem::Net::HTTP::Persistent::Connection # :nodoc:

  attr_accessor :http

  attr_accessor :last_use

  attr_accessor :requests

  attr_accessor :ssl_generation

  def initialize http_class, http_args, ssl_generation
    @http           = http_class.new(*http_args)
    @ssl_generation = ssl_generation

    reset
  end

  def finish
    @http.finish
  rescue IOError
  ensure
    reset
  end
  alias_method :close, :finish

  def reset
    @last_use = Gem::Net::HTTP::Persistent::EPOCH
    @requests = 0
  end

  def ressl ssl_generation
    @ssl_generation = ssl_generation

    finish
  end

end

Version data entries

56 entries across 56 versions & 4 rubygems

Version Path
rubygems-update-3.5.7 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.7 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.6 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.6 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.5 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.5 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.4 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.4 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.3 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.3 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.2 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.2 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.1 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.1 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.0 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.0 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb