Writing entire packet at once to avoid incomplete transmission
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
44d7233201
commit
5de2c3c2d3
@ -811,15 +811,15 @@ module Net #:nodoc:
|
||||
if use_ssl?
|
||||
begin
|
||||
if proxy?
|
||||
@socket.writeline sprintf('CONNECT %s:%s HTTP/%s',
|
||||
@address, @port, HTTPVersion)
|
||||
@socket.writeline "Host: #{@address}:#{@port}"
|
||||
buf = "CONNECT #{@address}:#{@port} HTTP/#{HTTPVersion}\r\n"
|
||||
buf << "Host: #{@address}:#{@port}\r\n"
|
||||
if proxy_user
|
||||
credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
|
||||
credential.delete!("\r\n")
|
||||
@socket.writeline "Proxy-Authorization: Basic #{credential}"
|
||||
buf << "Proxy-Authorization: Basic #{credential}\r\n"
|
||||
end
|
||||
@socket.writeline ''
|
||||
buf << "\r\n"
|
||||
@socket.write(buf)
|
||||
HTTPResponse.read_new(@socket).value
|
||||
end
|
||||
# Server Name Indication (SNI) RFC 3546
|
||||
|
Loading…
x
Reference in New Issue
Block a user