ruby-changes:45827
From: naruse <ko1@a...>
Date: Sun, 12 Mar 2017 16:53:39 +0900 (JST)
Subject: [ruby-changes:45827] naruse:r57900 (ruby_2_4): merge revision(s) 57690-57694:
naruse 2017-03-12 16:53:34 +0900 (Sun, 12 Mar 2017) New Revision: 57900 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57900 Log: merge revision(s) 57690-57694: rational.c: infinity in power * rational.c (nurat_expt): return 0 due to overflow. [ruby-core:79686] [Bug #13242]: ------------------------------------------------------------------------ r57690 | nobu | 2017-02-23 10:15:27 +0900 (Thu, 23 Feb 2017) | 7 lines [DOC] {read,write}_nonblock with exception: false Update docs to reflect EOF behavior change of read_nonblock and write_nonblock when using `exception: false`. [Fix GH-1527] Author: Russell Davis <russell-stripe@u...> ------------------------------------------------------------------------ r57691 | nobu | 2017-02-23 10:54:13 +0900 (Thu, 23 Feb 2017) | 11 lines socket.rb: [DOC] fix nonblock methods * ext/socket/lib/socket.rb (BasicSocket#recv_nonblock): fix exception class and symbol. * ext/socket/lib/socket.rb (BasicSocket#recvmsg_nonblock): ditto. * ext/socket/lib/socket.rb (Socket#recvfrom_nonblock): fix the method name. * ext/socket/lib/socket.rb (UDPSocket#recvfrom_nonblock): both. ------------------------------------------------------------------------ r57692 | nobu | 2017-02-23 11:00:28 +0900 (Thu, 23 Feb 2017) | 1 line [DOC] keyword argument _exception_ ------------------------------------------------------------------------ r57693 | nobu | 2017-02-23 11:11:16 +0900 (Thu, 23 Feb 2017) | 1 line [DOC] mark up literals ------------------------------------------------------------------------ r57694 | nobu | 2017-02-23 11:40:17 +0900 (Thu, 23 Feb 2017) | 3 lines Revert r57690 except for read_nonblock https://github.com/ruby/ruby/pull/1527#issuecomment-281867551 Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/ext/openssl/lib/openssl/buffering.rb branches/ruby_2_4/ext/openssl/ossl_ssl.c branches/ruby_2_4/ext/socket/lib/socket.rb branches/ruby_2_4/prelude.rb branches/ruby_2_4/version.h Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 57899) +++ ruby_2_4/version.h (revision 57900) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.0" #define RUBY_RELEASE_DATE "2017-03-12" -#define RUBY_PATCHLEVEL 57 +#define RUBY_PATCHLEVEL 58 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_4/prelude.rb =================================================================== --- ruby_2_4/prelude.rb (revision 57899) +++ ruby_2_4/prelude.rb (revision 57900) @@ -68,9 +68,10 @@ class IO https://github.com/ruby/ruby/blob/trunk/ruby_2_4/prelude.rb#L68 # Note that this method is identical to readpartial # except the non-blocking flag is set. # - # By specifying `exception: false`, the options hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that read_nonblock should not raise an IO::WaitReadable exception, but - # return the symbol :wait_readable instead. + # return the symbol +:wait_readable+ instead. At EOF, it will return nil + # instead of raising EOFError. def read_nonblock(len, buf = nil, exception: true) __read_nonblock(len, buf, exception) end @@ -126,9 +127,9 @@ class IO https://github.com/ruby/ruby/blob/trunk/ruby_2_4/prelude.rb#L127 # according to the kind of the IO object. # In such cases, write_nonblock raises <code>Errno::EBADF</code>. # - # By specifying `exception: false`, the options hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that write_nonblock should not raise an IO::WaitWritable exception, but - # return the symbol :wait_writable instead. + # return the symbol +:wait_writable+ instead. def write_nonblock(buf, exception: true) __write_nonblock(buf, exception) end Index: ruby_2_4/ext/openssl/ossl_ssl.c =================================================================== --- ruby_2_4/ext/openssl/ossl_ssl.c (revision 57899) +++ ruby_2_4/ext/openssl/ossl_ssl.c (revision 57900) @@ -1598,10 +1598,10 @@ ossl_ssl_connect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/openssl/ossl_ssl.c#L1598 * retry * end * - * By specifying `exception: false`, the options hash allows you to indicate + * By specifying a keyword argument _exception_ to +false+, you can indicate * that connect_nonblock should not raise an IO::WaitReadable or - * IO::WaitWritable exception, but return the symbol :wait_readable or - * :wait_writable instead. + * IO::WaitWritable exception, but return the symbol +:wait_readable+ or + * +:wait_writable+ instead. */ static VALUE ossl_ssl_connect_nonblock(int argc, VALUE *argv, VALUE self) @@ -1646,10 +1646,10 @@ ossl_ssl_accept(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/openssl/ossl_ssl.c#L1646 * retry * end * - * By specifying `exception: false`, the options hash allows you to indicate + * By specifying a keyword argument _exception_ to +false+, you can indicate * that accept_nonblock should not raise an IO::WaitReadable or - * IO::WaitWritable exception, but return the symbol :wait_readable or - * :wait_writable instead. + * IO::WaitWritable exception, but return the symbol +:wait_readable+ or + * +:wait_writable+ instead. */ static VALUE ossl_ssl_accept_nonblock(int argc, VALUE *argv, VALUE self) Index: ruby_2_4/ext/openssl/lib/openssl/buffering.rb =================================================================== --- ruby_2_4/ext/openssl/lib/openssl/buffering.rb (revision 57899) +++ ruby_2_4/ext/openssl/lib/openssl/buffering.rb (revision 57900) @@ -164,9 +164,10 @@ module OpenSSL::Buffering https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/openssl/lib/openssl/buffering.rb#L164 # when the peer requests a new TLS/SSL handshake. See openssl the FAQ for # more details. http://www.openssl.org/support/faq.html # - # By specifying `exception: false`, the options hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that read_nonblock should not raise an IO::Wait*able exception, but - # return the symbol :wait_writable or :wait_readable instead. + # return the symbol +:wait_writable+ or +:wait_readable+ instead. At EOF, + # it will return +nil+ instead of raising EOFError. def read_nonblock(maxlen, buf=nil, exception: true) if maxlen == 0 @@ -376,9 +377,9 @@ module OpenSSL::Buffering https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/openssl/lib/openssl/buffering.rb#L377 # is when the peer requests a new TLS/SSL handshake. See the openssl FAQ # for more details. http://www.openssl.org/support/faq.html # - # By specifying `exception: false`, the options hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that write_nonblock should not raise an IO::Wait*able exception, but - # return the symbol :wait_writable or :wait_readable instead. + # return the symbol +:wait_writable+ or +:wait_readable+ instead. def write_nonblock(s, exception: true) flush Index: ruby_2_4/ext/socket/lib/socket.rb =================================================================== --- ruby_2_4/ext/socket/lib/socket.rb (revision 57899) +++ ruby_2_4/ext/socket/lib/socket.rb (revision 57900) @@ -313,9 +313,9 @@ class BasicSocket < IO https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L313 # but the non-blocking flag is set before the system call # and it doesn't retry the system call. # - # By specifying `exception: false`, the _opts_ hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that sendmsg_nonblock should not raise an IO::WaitWritable exception, but - # return the symbol :wait_writable instead. + # return the symbol +:wait_writable+ instead. def sendmsg_nonblock(mesg, flags = 0, dest_sockaddr = nil, *controls, exception: true) __sendmsg_nonblock(mesg, flags, dest_sockaddr, controls, exception) @@ -361,9 +361,9 @@ class BasicSocket < IO https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L361 # it is extended by IO::WaitReadable. # So IO::WaitReadable can be used to rescue the exceptions for retrying recv_nonblock. # - # By specifying `exception: false`, the options hash allows you to indicate - # that recv_nonblock should not raise an IO::WaitWritable exception, but - # return the symbol :wait_writable instead. + # By specifying a keyword argument _exception_ to +false+, you can indicate + # that recv_nonblock should not raise an IO::WaitReadable exception, but + # return the symbol +:wait_readable+ instead. # # === See # * Socket#recvfrom @@ -435,9 +435,9 @@ class BasicSocket < IO https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L435 # but non-blocking flag is set before the system call # and it doesn't retry the system call. # - # By specifying `exception: false`, the _opts_ hash allows you to indicate - # that recvmsg_nonblock should not raise an IO::WaitWritable exception, but - # return the symbol :wait_writable instead. + # By specifying a keyword argument _exception_ to +false+, you can indicate + # that recvmsg_nonblock should not raise an IO::WaitReadable exception, but + # return the symbol +:wait_readable+ instead. def recvmsg_nonblock(dlen = nil, flags = 0, clen = nil, scm_rights: false, exception: true) __recvmsg_nonblock(dlen, flags, clen, scm_rights, exception) @@ -512,9 +512,9 @@ class Socket < BasicSocket https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L512 # So IO::WaitReadable can be used to rescue the exceptions for retrying # recvfrom_nonblock. # - # By specifying `exception: false`, the options hash allows you to indicate - # that accept_nonblock should not raise an IO::WaitReadable exception, but - # return the symbol :wait_readable instead. + # By specifying a keyword argument _exception_ to +false+, you can indicate + # that recvfrom_nonblock should not raise an IO::WaitReadable exception, but + # return the symbol +:wait_readable+ instead. # # === See # * Socket#recvfrom @@ -569,9 +569,9 @@ class Socket < BasicSocket https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L569 # it is extended by IO::WaitReadable. # So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock. # - # By specifying `exception: false`, the options hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that accept_nonblock should not raise an IO::WaitReadable exception, but - # return the symbol :wait_readable instead. + # return the symbol +:wait_readable+ instead. # # === See # * Socket#accept @@ -1188,9 +1188,9 @@ class Socket < BasicSocket https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L1188 # it is extended by IO::WaitWritable. # So IO::WaitWritable can be used to rescue the exceptions for retrying connect_nonblock. # - # By specifying `exception: false`, the options hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that connect_nonblock should not raise an IO::WaitWritable exception, but - # return the symbol :wait_writable instead. + # return the symbol +:wait_writable+ instead. # # === See # # Socket#connect @@ -1246,9 +1246,9 @@ class UDPSocket < IPSocket https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L1246 # it is extended by IO::WaitReadable. # So IO::WaitReadable can be used to rescue the exceptions for retrying recvfrom_nonblock. # - # By specifying `exception: false`, the options hash allows you to indicate - # that recvmsg_nonblock should not raise an IO::WaitWritable exception, but - # return the symbol :wait_writable instead. + # By specifying a keyword argument _exception_ to +false+, you can indicate + # that recvfrom_nonblock should not raise an IO::WaitReadable exception, but + # return the symbol +:wait_readable+ instead. # # === See # * Socket#recvfrom @@ -1287,9 +1287,9 @@ class TCPServer < TCPSocket https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L1287 # it is extended by IO::WaitReadable. # So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock. # - # By specifying `exception: false`, the options hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that accept_nonblock should not raise an IO::WaitReadable exception, but - # return the symbol :wait_readable instead. + # return the symbol +:wait_readable+ instead. # # === See # * TCPServer#accept @@ -1328,9 +1328,9 @@ class UNIXServer < UNIXSocket https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/socket/lib/socket.rb#L1328 # it is extended by IO::WaitReadable. # So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock. # - # By specifying `exception: false`, the options hash allows you to indicate + # By specifying a keyword argument _exception_ to +false+, you can indicate # that accept_nonblock should not raise an IO::WaitReadable exception, but - # return the symbol :wait_readable instead. + # return the symbol +:wait_readable+ instead. # # === See # * UNIXServer#accept Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r57690-57694 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/