summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/ancdata.c2
-rw-r--r--ext/socket/lib/socket.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 168f70c311..8fcd53c9fb 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1465,7 +1465,7 @@ bsock_recvmsg_internal(VALUE sock,
int gc_done = 0;
#endif
- maxdatlen = NUM2SIZET(vmaxdatlen);
+ maxdatlen = NIL_P(vmaxdatlen) ? 4061 : NUM2SIZET(vmaxdatlen);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
maxctllen = NIL_P(vmaxctllen) ? 4096 : NUM2SIZET(vmaxctllen);
#else
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 58e7dfd92a..0240c2094e 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -425,7 +425,7 @@ class BasicSocket < IO
# return ancdata.unix_rights[0]
# end
# }
- def recvmsg(dlen = 4096, flags = 0, clen = nil, scm_rights: false)
+ def recvmsg(dlen = nil, 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 = nil,
+ def recvmsg_nonblock(dlen = nil, flags = 0, clen = nil,
scm_rights: false, exception: true)
__recvmsg_nonblock(dlen, flags, clen, scm_rights, exception)
end