diff options
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/http.rb | 11 | ||||
-rw-r--r-- | lib/net/imap.rb | 7 | ||||
-rw-r--r-- | lib/net/pop.rb | 4 | ||||
-rw-r--r-- | lib/net/smtp.rb | 13 |
4 files changed, 19 insertions, 16 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index fd8c802935..67de15cd27 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -623,13 +623,13 @@ module Net #:nodoc: # Number of seconds to wait for the connection to open. Any number # may be used, including Floats for fractional seconds. If the HTTP # object cannot open a connection in this many seconds, it raises a - # TimeoutError exception. + # TimeoutError exception. The default value is +nil+. attr_accessor :open_timeout # Number of seconds to wait for one block to be read (via one read(2) # call). Any number may be used, including Floats for fractional # seconds. If the HTTP object cannot read data in this many seconds, - # it raises a TimeoutError exception. + # it raises a TimeoutError exception. The default value is 60 seconds. attr_reader :read_timeout # Setter for the read_timeout attribute. @@ -638,8 +638,9 @@ module Net #:nodoc: @read_timeout = sec end - # Seconds to wait for 100 Continue response. If the HTTP object does not - # receive a response in this many seconds it sends the request body. + # Seconds to wait for 100 Continue response. If the HTTP object does not + # receive a response in this many seconds it sends the request body. The + # default value is +nil+. attr_reader :continue_timeout # Setter for the continue_timeout attribute. @@ -1947,7 +1948,7 @@ module Net #:nodoc: wait_for_continue sock, ver if sock.continue_timeout if chunked? while s = f.read(1024) - sock.write(sprintf("%x\r\n", s.length) << s << "\r\n") + sock.write(sprintf("%x\r\n", s.bytesize) << s << "\r\n") end sock.write "0\r\n\r\n" else diff --git a/lib/net/imap.rb b/lib/net/imap.rb index e0815a1892..df9ee8ce1e 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -1725,7 +1725,7 @@ module Net # rights:: The access rights the indicated user has to the # mailbox. # - MailboxACLItem = Struct.new(:user, :rights) + MailboxACLItem = Struct.new(:user, :rights, :mailbox) # Net::IMAP::StatusData represents contents of the STATUS response. # @@ -2722,6 +2722,7 @@ module Net token = match(T_ATOM) name = token.value.upcase match(T_SPACE) + mailbox = astring data = [] token = lookahead if token.symbol == T_SPACE @@ -2737,8 +2738,7 @@ module Net user = astring match(T_SPACE) rights = astring - ##XXX data.push([user, rights]) - data.push(MailboxACLItem.new(user, rights)) + data.push(MailboxACLItem.new(user, rights, mailbox)) end end return UntaggedResponse.new(name, data, @str) @@ -2869,6 +2869,7 @@ module Net break when T_SPACE shift_token + next end data.push(atom.upcase) end diff --git a/lib/net/pop.rb b/lib/net/pop.rb index 7e14246d16..ff2d77f72a 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -498,12 +498,12 @@ module Net # Seconds to wait until a connection is opened. # If the POP3 object cannot open a connection within this time, - # it raises a TimeoutError exception. + # it raises a TimeoutError exception. The default value is 30 seconds. attr_accessor :open_timeout # Seconds to wait until reading one block (by one read(1) call). # If the POP3 object cannot complete a read() within this time, - # it raises a TimeoutError exception. + # it raises a TimeoutError exception. The default value is 60 seconds. attr_reader :read_timeout # Set the read timeout. diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 33b88f5c21..3c7af8008c 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -78,8 +78,9 @@ module Net # # This library does NOT provide functions to compose internet mails. # You must create them by yourself. If you want better mail support, - # try RubyMail or TMail. You can get both libraries from RAA. - # (http://www.ruby-lang.org/en/raa.html) + # try RubyMail or TMail or search for alternatives in + # {RubyGems.org}[https://rubygems.org/] or {The Ruby + # Toolbox}[https://www.ruby-toolbox.com/]. # # FYI: the official documentation on internet mail is: [RFC2822] (http://www.ietf.org/rfc/rfc2822.txt). # @@ -364,12 +365,12 @@ module Net # Seconds to wait while attempting to open a connection. # If the connection cannot be opened within this time, a - # TimeoutError is raised. + # TimeoutError is raised. The default value is 30 seconds. attr_accessor :open_timeout # Seconds to wait while reading one block (by one read(2) call). # If the read(2) call does not complete within this time, a - # TimeoutError is raised. + # TimeoutError is raised. The default value is 60 seconds. attr_reader :read_timeout # Set the number of seconds to wait until timing-out a read(2) @@ -934,11 +935,11 @@ module Net end def critical(&block) - return '200 dummy reply code' if @error_occured + return Response.parse('200 dummy reply code') if @error_occurred begin return yield() rescue Exception - @error_occured = true + @error_occurred = true raise end end |