* 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:
parent
4b9cd6edce
commit
66e2139b1a
@ -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>
|
Tue Nov 17 13:43:46 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ext/socket/lib/socket.rb: UNIXSocket is not always exists. fixes
|
* ext/socket/lib/socket.rb: UNIXSocket is not always exists. fixes
|
||||||
|
@ -1467,7 +1467,7 @@ bsock_recvmsg_internal(VALUE sock,
|
|||||||
|
|
||||||
maxdatlen = NUM2SIZET(vmaxdatlen);
|
maxdatlen = NUM2SIZET(vmaxdatlen);
|
||||||
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
|
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
|
||||||
maxctllen = NUM2SIZET(vmaxctllen);
|
maxctllen = NIL_P(vmaxctllen) ? 4096 : NUM2SIZET(vmaxctllen);
|
||||||
#else
|
#else
|
||||||
if (!NIL_P(vmaxctllen))
|
if (!NIL_P(vmaxctllen))
|
||||||
rb_raise(rb_eArgError, "control message not supported");
|
rb_raise(rb_eArgError, "control message not supported");
|
||||||
|
@ -425,7 +425,7 @@ class BasicSocket < IO
|
|||||||
# return ancdata.unix_rights[0]
|
# return ancdata.unix_rights[0]
|
||||||
# end
|
# 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)
|
__recvmsg(dlen, flags, clen, scm_rights)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -441,7 +441,7 @@ class BasicSocket < IO
|
|||||||
# By specifying `exception: false`, the _opts_ hash allows you to indicate
|
# By specifying `exception: false`, the _opts_ hash allows you to indicate
|
||||||
# that recvmsg_nonblock should not raise an IO::WaitWritable exception, but
|
# that recvmsg_nonblock should not raise an IO::WaitWritable exception, but
|
||||||
# return the symbol :wait_writable instead.
|
# 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)
|
scm_rights: false, exception: true)
|
||||||
__recvmsg_nonblock(dlen, flags, clen, scm_rights, exception)
|
__recvmsg_nonblock(dlen, flags, clen, scm_rights, exception)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user