lonbaker (owner)

Revisions

gist: 54678 Download_button fork
public
Public Clone URL: git://gist.github.com/54678.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'net/http'
 
module Net
 
  class HTTP
    
    alias :orig_initialize :initialize
   
    # Override HTTP#initialize to set a default @open_timeout to 10 secs. Original
    # initialize method sets @open_timeout to nil, causing connect to wait until
    # able to open a TCPSocket.
    def initialize(*args)
      orig_initialize(*args)
      @open_timeout ||= 10
    end
    
  end
 
end