mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rescue EPIPE raised from conn.print because of client's timeout
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8bcf7fc402
commit
3cbf88d8d4
1 changed files with 13 additions and 11 deletions
|
@ -327,6 +327,7 @@ class FTPTest < Test::Unit::TestCase
|
|||
sock.print("200 PORT command successful.\r\n")
|
||||
commands.push(sock.gets)
|
||||
sock.print("150 Here comes the directory listing.\r\n")
|
||||
begin
|
||||
conn = TCPSocket.new(host, port)
|
||||
list_lines.each_with_index do |l, i|
|
||||
if i == 1
|
||||
|
@ -336,10 +337,11 @@ class FTPTest < Test::Unit::TestCase
|
|||
end
|
||||
conn.print(l, "\r\n")
|
||||
end
|
||||
conn.shutdown(Socket::SHUT_WR)
|
||||
conn.read_timeout = 1
|
||||
conn.read unless conn.eof?
|
||||
rescue Errno::EPIPE
|
||||
ensure
|
||||
assert_nil($!)
|
||||
conn.close
|
||||
end
|
||||
sock.print("226 Directory send OK.\r\n")
|
||||
}
|
||||
begin
|
||||
|
|
Loading…
Reference in a new issue