* 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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ngoto 2015-03-02 03:07:18 +00:00
Родитель f2c8ac3f1a
Коммит ba536e4154
2 изменённых файлов: 13 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Mon Mar 2 12:05:04 2015 Naohisa Goto <ngotogenome@gmail.com>
* 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@ruby-lang.org> Mon Mar 2 11:43:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_REPLACE_TYPE): restore unsigned type from * configure.in (RUBY_REPLACE_TYPE): restore unsigned type from

Просмотреть файл

@ -711,7 +711,7 @@ class FTPTest < Test::Unit::TestCase
sock.print("230 Login successful.\r\n") sock.print("230 Login successful.\r\n")
commands.push(sock.gets) commands.push(sock.gets)
sock.print("200 Switching to Binary mode.\r\n") 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") sock.print("225 No transfer to ABOR.\r\n")
} }
begin begin
@ -724,7 +724,7 @@ class FTPTest < Test::Unit::TestCase
assert_match(/\APASS /, commands.shift) assert_match(/\APASS /, commands.shift)
assert_equal("TYPE I\r\n", commands.shift) assert_equal("TYPE I\r\n", commands.shift)
ftp.abort ftp.abort
assert_equal("ABOR\r", commands.shift) assert_equal("ABOR\r\n", commands.shift)
assert_equal(nil, commands.shift) assert_equal(nil, commands.shift)
ensure ensure
ftp.close if ftp ftp.close if ftp
@ -744,7 +744,7 @@ class FTPTest < Test::Unit::TestCase
sock.print("230 Login successful.\r\n") sock.print("230 Login successful.\r\n")
commands.push(sock.gets) commands.push(sock.gets)
sock.print("200 Switching to Binary mode.\r\n") 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") sock.print("211 End of status\r\n")
} }
begin begin
@ -757,7 +757,7 @@ class FTPTest < Test::Unit::TestCase
assert_match(/\APASS /, commands.shift) assert_match(/\APASS /, commands.shift)
assert_equal("TYPE I\r\n", commands.shift) assert_equal("TYPE I\r\n", commands.shift)
ftp.status ftp.status
assert_equal("STAT\r", commands.shift) assert_equal("STAT\r\n", commands.shift)
assert_equal(nil, commands.shift) assert_equal(nil, commands.shift)
ensure ensure
ftp.close if ftp ftp.close if ftp
@ -856,6 +856,7 @@ class FTPTest < Test::Unit::TestCase
end end
sock = server.accept sock = server.accept
begin begin
sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_OOBINLINE, 1)
yield(sock) yield(sock)
sock.shutdown(Socket::SHUT_WR) sock.shutdown(Socket::SHUT_WR)
sock.read unless sock.eof? sock.read unless sock.eof?