aboutsummaryrefslogtreecommitdiffstats
path: root/test/net
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-02 03:07:18 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-02 03:07:18 +0000
commitba536e41549f694d5c7434edb967ee571b2161c2 (patch)
tree448718743b4168d64369239713f464989c0f62e2 /test/net
parentf2c8ac3f1a68f75e0f43a4ab390ec1a0414bba7d (diff)
downloadruby-ba536e41549f694d5c7434edb967ee571b2161c2.tar.gz
* 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
Diffstat (limited to 'test/net')
-rw-r--r--test/net/ftp/test_ftp.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index 667a9e1e18..6fae078bc7 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -711,7 +711,7 @@ class FTPTest < Test::Unit::TestCase
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
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
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
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
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?