ruby-changes:9627
From: matz <ko1@a...>
Date: Mon, 29 Dec 2008 17:14:55 +0900 (JST)
Subject: [ruby-changes:9627] Ruby:r21167 (trunk): * ext/socket/socket.c (s_recvfrom_nonblock): revert r21162.
matz 2008-12-29 17:14:35 +0900 (Mon, 29 Dec 2008) New Revision: 21167 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21167 Log: * ext/socket/socket.c (s_recvfrom_nonblock): revert r21162. Modified files: trunk/ChangeLog trunk/ext/socket/socket.c Index: ChangeLog =================================================================== --- ChangeLog (revision 21166) +++ ChangeLog (revision 21167) @@ -1,3 +1,7 @@ +Mon Dec 29 16:52:15 2008 Yukihiro Matsumoto <matz@r...> + + * ext/socket/socket.c (s_recvfrom_nonblock): revert r21162. + Mon Dec 29 16:16:20 2008 Koichi Sasada <ko1@a...> * vm.c (vm_set_eval_stack, vm_set_main_stack, vm_set_top_stack): @@ -31,15 +35,6 @@ * io.c (rb_scan_open_args): ditto. -Mon Dec 29 10:12:12 2008 Yukihiro Matsumoto <matz@r...> - - * ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to be - 65536. suggested by akr in [ruby-core:20918]. response to - feature request #936 in [ruby-core:20917]. - - * ext/socket/socket.c (s_recvfrom_nonblock): fixed awesome typo. - sorry. - Mon Dec 29 07:15:16 2008 Yukihiro Matsumoto <matz@r...> * cont.c: small RDoc fix mentioned from <radek.bulat at gmail.com> Index: ext/socket/socket.c =================================================================== --- ext/socket/socket.c (revision 21166) +++ ext/socket/socket.c (revision 21167) @@ -690,12 +690,11 @@ int fd, flags; VALUE addr = Qnil; - rb_scan_args(argc, argv, "02", &len, &flg); + rb_scan_args(argc, argv, "11", &len, &flg); - if (len == Qnil) buflen = 65536; - else buflen = NUM2INT(len); if (flg == Qnil) flags = 0; else flags = NUM2INT(flg); + buflen = NUM2INT(len); #ifdef MSG_DONTWAIT /* MSG_DONTWAIT avoids the race condition between fcntl and recvfrom. @@ -749,13 +748,11 @@ /* * call-seq: - * basicsocket.recv_nonblock() => mesg * basicsocket.recv_nonblock(maxlen) => mesg * basicsocket.recv_nonblock(maxlen, flags) => mesg * * Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after * O_NONBLOCK is set for the underlying file descriptor. - * If _maxlen_ is ommitted, its default value is 65536. * _flags_ is zero or more of the +MSG_+ options. * The result, _mesg_, is the data received. * @@ -1881,7 +1878,6 @@ /* * call-seq: - * udpsocket.recvfrom_nonblock() => [mesg, sender_inet_addr] * udpsocket.recvfrom_nonblock(maxlen) => [mesg, sender_inet_addr] * udpsocket.recvfrom_nonblock(maxlen, flags) => [mesg, sender_inet_addr] * @@ -1924,6 +1920,7 @@ static VALUE udp_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock) { + return s_recvfrom_nonblock(sock, argc, argv, RECV_IP); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/