ruby-changes:37719
From: ngoto <ko1@a...>
Date: Mon, 2 Mar 2015 12:07:32 +0900 (JST)
Subject: [ruby-changes:37719] ngoto:r49800 (trunk): * test/net/ftp/test_ftp.rb (create_ftp_server): set SO_OOBINLINE
ngoto 2015-03-02 12:07:18 +0900 (Mon, 02 Mar 2015) New Revision: 49800 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49800 Log: * test/net/ftp/test_ftp.rb (create_ftp_server): set SO_OOBINLINE for receiving OOB data which is sended with MSG_OOB flag in portable way. [Bug #10915] [ruby-dev:48885] * test/net/ftp/test_ftp.rb (test_abort, test_status): use gets for receiving OOB data in portable way. Modified files: trunk/ChangeLog trunk/test/net/ftp/test_ftp.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 49799) +++ ChangeLog (revision 49800) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Mar 2 12:05:04 2015 Naohisa Goto <ngotogenome@g...> + + * test/net/ftp/test_ftp.rb (create_ftp_server): set SO_OOBINLINE + for receiving OOB data which is sended with MSG_OOB flag in + portable way. [Bug #10915] [ruby-dev:48885] + * test/net/ftp/test_ftp.rb (test_abort, test_status): use gets + for receiving OOB data in portable way. + Mon Mar 2 11:43:07 2015 Nobuyoshi Nakada <nobu@r...> * configure.in (RUBY_REPLACE_TYPE): restore unsigned type from Index: test/net/ftp/test_ftp.rb =================================================================== --- test/net/ftp/test_ftp.rb (revision 49799) +++ test/net/ftp/test_ftp.rb (revision 49800) @@ -711,7 +711,7 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/ftp/test_ftp.rb#L711 sock.print("230 Login successful.\r\n") commands.push(sock.gets) sock.print("200 Switching to Binary mode.\r\n") - commands.push(sock.recv(1024)) + commands.push(sock.gets) sock.print("225 No transfer to ABOR.\r\n") } begin @@ -724,7 +724,7 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/ftp/test_ftp.rb#L724 assert_match(/\APASS /, commands.shift) assert_equal("TYPE I\r\n", commands.shift) ftp.abort - assert_equal("ABOR\r", commands.shift) + assert_equal("ABOR\r\n", commands.shift) assert_equal(nil, commands.shift) ensure ftp.close if ftp @@ -744,7 +744,7 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/ftp/test_ftp.rb#L744 sock.print("230 Login successful.\r\n") commands.push(sock.gets) sock.print("200 Switching to Binary mode.\r\n") - commands.push(sock.recv(1024)) + commands.push(sock.gets) sock.print("211 End of status\r\n") } begin @@ -757,7 +757,7 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/ftp/test_ftp.rb#L757 assert_match(/\APASS /, commands.shift) assert_equal("TYPE I\r\n", commands.shift) ftp.status - assert_equal("STAT\r", commands.shift) + assert_equal("STAT\r\n", commands.shift) assert_equal(nil, commands.shift) ensure ftp.close if ftp @@ -856,6 +856,7 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/ftp/test_ftp.rb#L856 end sock = server.accept begin + sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_OOBINLINE, 1) yield(sock) sock.shutdown(Socket::SHUT_WR) sock.read unless sock.eof? -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/