[ruby-cvs:67677] normal:r60496 (trunk): socket: fix BasicSocket#*_nonblock buffering bugs from r58400

normal at ruby-lang.org normal at ruby-lang.org
Sat Oct 28 08:26:48 JST 2017


normal	2017-10-28 08:26:48 +0900 (Sat, 28 Oct 2017)

  New Revision: 60496

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60496

  Log:
    socket: fix BasicSocket#*_nonblock buffering bugs from r58400
    
    IO#read_nonblock and IO#write_nonblock take into account
    buffered data, so the Linux-only BasicSocket#read_nonblock
    and BasicSocket#write_nonblock methods must, too.
    
    This bug was only introduced in r58400
    ("socket: avoid fcntl for read/write_nonblock on Linux")
    and does not affect any stable release.
    
    * ext/socket/basicsocket.c (rsock_init_basicsocket):
    * ext/socket/init.c (rsock_s_recvfrom_nonblock):
    * ext/socket/init.c (rsock_init_socket_init):
    * ext/socket/lib/socket.rb (def read_nonblock):
    * ext/socket/lib/socket.rb (def write_nonblock):
    * ext/socket/rubysocket.h (static inline void rsock_maybe_wait_fd):
    * test/socket/test_basicsocket.rb (def test_read_write_nonblock):
      [Feature #13362]

  Modified files:
    trunk/ext/socket/basicsocket.c
    trunk/ext/socket/init.c
    trunk/ext/socket/lib/socket.rb
    trunk/ext/socket/rubysocket.h
    trunk/test/socket/test_basicsocket.rb


More information about the ruby-cvs mailing list