Sha256: 1d016d1f6221a4c47451a0e454080e5fc850420e811e1ff1e783ed94a2f96a35

Contents?: true

Size: 701 Bytes

Versions: 15

Compression:

Stored size: 701 Bytes

Contents

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

class 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 = Net::HTTP::Persistent::EPOCH
    @requests = 0
  end

  def ressl ssl_generation
    @ssl_generation = ssl_generation

    finish
  end

end

Version data entries

15 entries across 9 versions & 2 rubygems

Version Path
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.18 vendor/bundle/ruby/3.0.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.17 vendor/bundle/ruby/3.0.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.16 vendor/bundle/ruby/3.0.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
net-http-persistent-4.0.4 lib/net/http/persistent/connection.rb
net-http-persistent-4.0.3 lib/net/http/persistent/connection.rb
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.13 vendor/bundle/ruby/3.0.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.12 vendor/bundle/ruby/3.0.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
direct7-0.0.11 vendor/bundle/ruby/3.0.0/gems/net-http-persistent-4.0.2/lib/net/http/persistent/connection.rb
net-http-persistent-4.0.2 lib/net/http/persistent/connection.rb