ruby-changes:52017
From: naruse <ko1@a...>
Date: Wed, 8 Aug 2018 22:50:30 +0900 (JST)
Subject: [ruby-changes:52017] naruse:r64232 (trunk): fix MSG_OOB spec
naruse 2018-08-08 22:50:25 +0900 (Wed, 08 Aug 2018) New Revision: 64232 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64232 Log: fix MSG_OOB spec * OOBINLINE should be set for accepted socket * When OOBINLINE is set, MSG_OOB shouldn't be passed to recv Merge spec/ruby's commit 5b418374f8006318434ee9a2366382d004f585df Modified files: trunk/spec/ruby/library/socket/basicsocket/send_spec.rb Index: spec/ruby/library/socket/basicsocket/send_spec.rb =================================================================== --- spec/ruby/library/socket/basicsocket/send_spec.rb (revision 64231) +++ spec/ruby/library/socket/basicsocket/send_spec.rb (revision 64232) @@ -196,17 +196,11 @@ describe 'BasicSocket#send' do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/socket/basicsocket/send_spec.rb#L196 describe 'using the MSG_OOB flag' do it 'sends an out-of-band message' do - @server.setsockopt(:SOCKET, :OOBINLINE, true) - - @client.send('a', Socket::MSG_OOB).should == 1 - - platform_is :freebsd do # recv hangs otherwise - @client.close - end - socket, _ = @server.accept + socket.setsockopt(:SOCKET, :OOBINLINE, true) + @client.send('a', Socket::MSG_OOB).should == 1 begin - socket.recv(1, Socket::MSG_OOB).should == 'a' + socket.recv(10).should == 'a' ensure socket.close end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/