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

* 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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2015-11-17 05:06:18 +00:00
parent 4b9cd6edce
commit 66e2139b1a
3 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,11 @@
Tue Nov 17 14:04:14 2015 NAKAMURA Usaku <usa@ruby-lang.org>
* 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@ruby-lang.org>
* ext/socket/lib/socket.rb: UNIXSocket is not always exists. fixes

View file

@ -1467,7 +1467,7 @@ bsock_recvmsg_internal(VALUE sock,
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");

View file

@ -425,7 +425,7 @@ class BasicSocket < IO
# 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
# 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