ruby-changes:40529
From: usa <ko1@a...>
Date: Tue, 17 Nov 2015 14:06:43 +0900 (JST)
Subject: [ruby-changes:40529] usa:r52610 (trunk): * ext/socket/lib/socket.rb (Socket#recvmsg{, _nonblock}): default values
usa 2015-11-17 14:06:18 +0900 (Tue, 17 Nov 2015) New Revision: 52610 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52610 Log: * ext/socket/lib/socket.rb (Socket#recvmsg{,_nonblock}): default values of clen must be nil. * ext/socket/ancdata.c (bsock_sendmsg_internal): handle nil of clen. fixes test errors introduced at r52602. Modified files: trunk/ChangeLog trunk/ext/socket/ancdata.c trunk/ext/socket/lib/socket.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 52609) +++ ChangeLog (revision 52610) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Nov 17 14:04:14 2015 NAKAMURA Usaku <usa@r...> + + * ext/socket/lib/socket.rb (Socket#recvmsg{,_nonblock}): default values + of clen must be nil. + + * ext/socket/ancdata.c (bsock_sendmsg_internal): handle nil of clen. + fixes test errors introduced at r52602. + Tue Nov 17 13:43:46 2015 NAKAMURA Usaku <usa@r...> * ext/socket/lib/socket.rb: UNIXSocket is not always exists. fixes Index: ext/socket/lib/socket.rb =================================================================== --- ext/socket/lib/socket.rb (revision 52609) +++ ext/socket/lib/socket.rb (revision 52610) @@ -425,7 +425,7 @@ class BasicSocket < IO https://github.com/ruby/ruby/blob/trunk/ext/socket/lib/socket.rb#L425 # return ancdata.unix_rights[0] # end # } - def recvmsg(dlen = 4096, flags = 0, clen = 4096, scm_rights: false) + def recvmsg(dlen = 4096, flags = 0, clen = nil, scm_rights: false) __recvmsg(dlen, flags, clen, scm_rights) end @@ -441,7 +441,7 @@ class BasicSocket < IO https://github.com/ruby/ruby/blob/trunk/ext/socket/lib/socket.rb#L441 # 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. - def recvmsg_nonblock(dlen = 4096, flags = 0, clen = 4096, + def recvmsg_nonblock(dlen = 4096, flags = 0, clen = nil, scm_rights: false, exception: true) __recvmsg_nonblock(dlen, flags, clen, scm_rights, exception) end Index: ext/socket/ancdata.c =================================================================== --- ext/socket/ancdata.c (revision 52609) +++ ext/socket/ancdata.c (revision 52610) @@ -1467,7 +1467,7 @@ bsock_recvmsg_internal(VALUE sock, https://github.com/ruby/ruby/blob/trunk/ext/socket/ancdata.c#L1467 maxdatlen = NUM2SIZET(vmaxdatlen); #if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) - maxctllen = NUM2SIZET(vmaxctllen); + maxctllen = NIL_P(vmaxctllen) ? 4096 : NUM2SIZET(vmaxctllen); #else if (!NIL_P(vmaxctllen)) rb_raise(rb_eArgError, "control message not supported"); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/