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:
parent
bfcb3fb3be
commit
dad2382270
5 changed files with 14 additions and 18 deletions
|
@ -446,8 +446,7 @@ module Net
|
||||||
if !resp.start_with?("1")
|
if !resp.start_with?("1")
|
||||||
raise FTPReplyError, resp
|
raise FTPReplyError, resp
|
||||||
end
|
end
|
||||||
conn = BufferedSocket.new(sock.accept)
|
conn = BufferedSocket.new(sock.accept, read_timeout: @read_timeout)
|
||||||
conn.read_timeout = @read_timeout
|
|
||||||
sock.shutdown(Socket::SHUT_WR) rescue nil
|
sock.shutdown(Socket::SHUT_WR) rescue nil
|
||||||
sock.read rescue nil
|
sock.read rescue nil
|
||||||
ensure
|
ensure
|
||||||
|
|
|
@ -925,10 +925,9 @@ module Net #:nodoc:
|
||||||
s.sync_close = true
|
s.sync_close = true
|
||||||
D "SSL established"
|
D "SSL established"
|
||||||
end
|
end
|
||||||
@socket = BufferedIO.new(s)
|
@socket = BufferedIO.new(s, read_timeout: @read_timeout,
|
||||||
@socket.read_timeout = @read_timeout
|
continue_timeout: @continue_timeout,
|
||||||
@socket.continue_timeout = @continue_timeout
|
debug_output: @debug_output)
|
||||||
@socket.debug_output = @debug_output
|
|
||||||
if use_ssl?
|
if use_ssl?
|
||||||
begin
|
begin
|
||||||
if proxy?
|
if proxy?
|
||||||
|
|
|
@ -555,10 +555,10 @@ module Net
|
||||||
s.post_connection_check(@address)
|
s.post_connection_check(@address)
|
||||||
end
|
end
|
||||||
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'})"
|
logging "POP session started: #{@address}:#{@port} (#{@apop ? 'APOP' : 'POP'})"
|
||||||
@socket.read_timeout = @read_timeout
|
|
||||||
@socket.debug_output = @debug_output
|
|
||||||
on_connect
|
on_connect
|
||||||
@command = POP3Command.new(@socket)
|
@command = POP3Command.new(@socket)
|
||||||
if apop?
|
if apop?
|
||||||
|
|
|
@ -79,11 +79,11 @@ module Net # :nodoc:
|
||||||
|
|
||||||
|
|
||||||
class BufferedIO #:nodoc: internal use only
|
class BufferedIO #:nodoc: internal use only
|
||||||
def initialize(io)
|
def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
|
||||||
@io = io
|
@io = io
|
||||||
@read_timeout = 60
|
@read_timeout = read_timeout
|
||||||
@continue_timeout = nil
|
@continue_timeout = continue_timeout
|
||||||
@debug_output = nil
|
@debug_output = debug_output
|
||||||
@rbuf = ''
|
@rbuf = ''
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ module Net # :nodoc:
|
||||||
|
|
||||||
|
|
||||||
class InternetMessageIO < BufferedIO #:nodoc: internal use only
|
class InternetMessageIO < BufferedIO #:nodoc: internal use only
|
||||||
def initialize(io)
|
def initialize(*)
|
||||||
super
|
super
|
||||||
@wbuf = nil
|
@wbuf = nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -592,10 +592,8 @@ module Net
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_internet_message_io(s)
|
def new_internet_message_io(s)
|
||||||
io = InternetMessageIO.new(s)
|
InternetMessageIO.new(s, read_timeout: @read_timeout,
|
||||||
io.read_timeout = @read_timeout
|
debug_output: @debug_output)
|
||||||
io.debug_output = @debug_output
|
|
||||||
io
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def do_helo(helo_domain)
|
def do_helo(helo_domain)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue