Project

General

Profile

Feature #16559 ยป dont-default-connection-close.patch

f3ndot (Justin Bull), 01/24/2020 03:19 PM

View differences:

lib/net/http.rb
# +dest+ argument is obsolete.
# It still works but you must not use it.
#
# If called before the connection has started, this method will open the
# connection and finish it once complete.
#
# This method never raises an exception.
#
# response = http.get('/index.html')
......
#
# This method returns a Net::HTTPResponse object.
#
# If called before the connection has started, this method will open the
# connection and finish it once complete.
#
# This method never raises an exception.
#
# response = nil
......
# the socket. Note that in this case, the returned response
# object will *not* contain a (meaningful) body.
#
# If called before the connection has started, this method will open the
# connection and finish it once complete.
#
# +dest+ argument is obsolete.
# It still works but you must not use it.
#
......
# the block can process it using HTTPResponse#read_body,
# if desired.
#
# If called before the connection has started, this method will open the
# connection and finish it once complete.
#
# This method never raises Net::* exceptions.
#
def request(req, body = nil, &block) # :yield: +response+
unless started?
start {
req['connection'] ||= 'close'
return request(req, body, &block)
}
start { return request(req, body, &block) }
end
if proxy_user()
req.proxy_basic_auth proxy_user(), proxy_pass() unless use_ssl?
......
end
end
if not req.response_body_permitted? and @close_on_empty_response
req['connection'] ||= 'close'
end
req.update_uri address, port, use_ssl?
req['host'] ||= addr_port()
end
    (1-1/1)