1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

net/protocol.rb: kwargs

* lib/net/protocol.rb (Net::BufferedIO#initialize): add keyword
  arguments for initial attributes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-11-14 07:53:32 +00:00
parent bfcb3fb3be
commit dad2382270
5 changed files with 14 additions and 18 deletions

View file

@ -446,8 +446,7 @@ module Net
if !resp.start_with?("1")
raise FTPReplyError, resp
end
conn = BufferedSocket.new(sock.accept)
conn.read_timeout = @read_timeout
conn = BufferedSocket.new(sock.accept, read_timeout: @read_timeout)
sock.shutdown(Socket::SHUT_WR) rescue nil
sock.read rescue nil
ensure

View file

@ -925,10 +925,9 @@ module Net #:nodoc:
s.sync_close = true
D "SSL established"
end
@socket = BufferedIO.new(s)
@socket.read_timeout = @read_timeout
@socket.continue_timeout = @continue_timeout
@socket.debug_output = @debug_output
@socket = BufferedIO.new(s, read_timeout: @read_timeout,
continue_timeout: @continue_timeout,
debug_output: @debug_output)
if use_ssl?
begin
if proxy?

View file

@ -555,10 +555,10 @@ module Net
s.post_connection_check(@address)
end
end
@socket = InternetMessageIO.new(s)
@socket = InternetMessageIO.new(s,
read_timeout: @read_timeout,
debug_output: @debug_output)
logging "POP session started: #{@address}:#{@port} (#{@apop ? 'APOP' : 'POP'})"
@socket.read_timeout = @read_timeout
@socket.debug_output = @debug_output
on_connect
@command = POP3Command.new(@socket)
if apop?

View file

@ -79,11 +79,11 @@ module Net # :nodoc:
class BufferedIO #:nodoc: internal use only
def initialize(io)
def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
@io = io
@read_timeout = 60
@continue_timeout = nil
@debug_output = nil
@read_timeout = read_timeout
@continue_timeout = continue_timeout
@debug_output = debug_output
@rbuf = ''
end
@ -254,7 +254,7 @@ module Net # :nodoc:
class InternetMessageIO < BufferedIO #:nodoc: internal use only
def initialize(io)
def initialize(*)
super
@wbuf = nil
end

View file

@ -592,10 +592,8 @@ module Net
end
def new_internet_message_io(s)
io = InternetMessageIO.new(s)
io.read_timeout = @read_timeout
io.debug_output = @debug_output
io
InternetMessageIO.new(s, read_timeout: @read_timeout,
debug_output: @debug_output)
end
def do_helo(helo_domain)