mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore
exceptions on server thread. Delete read_timeout method call to fix NoMethodError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0d70c707ae
commit
9bf5457481
2 changed files with 15 additions and 13 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Mon Nov 10 23:34:13 2014 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore
|
||||||
|
exceptions on server thread.
|
||||||
|
Delete read_timeout method call to fix NoMethodError.
|
||||||
|
|
||||||
Mon Nov 10 20:20:53 2014 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon Nov 10 20:20:53 2014 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* win32/win32.c (rb_w32_read): retry with reduced length if cannot to
|
* win32/win32.c (rb_w32_read): retry with reduced length if cannot to
|
||||||
|
|
|
@ -773,20 +773,16 @@ class FTPTest < Test::Unit::TestCase
|
||||||
def create_ftp_server(sleep_time = nil)
|
def create_ftp_server(sleep_time = nil)
|
||||||
server = TCPServer.new(SERVER_ADDR, 0)
|
server = TCPServer.new(SERVER_ADDR, 0)
|
||||||
@thread = Thread.start do
|
@thread = Thread.start do
|
||||||
|
if sleep_time
|
||||||
|
sleep(sleep_time)
|
||||||
|
end
|
||||||
|
sock = server.accept
|
||||||
begin
|
begin
|
||||||
if sleep_time
|
yield(sock)
|
||||||
sleep(sleep_time)
|
sock.shutdown(Socket::SHUT_WR)
|
||||||
end
|
sock.read unless sock.eof?
|
||||||
sock = server.accept
|
ensure
|
||||||
begin
|
sock.close
|
||||||
yield(sock)
|
|
||||||
sock.shutdown(Socket::SHUT_WR)
|
|
||||||
sock.read_timeout = 1
|
|
||||||
sock.read unless sock.eof?
|
|
||||||
ensure
|
|
||||||
sock.close
|
|
||||||
end
|
|
||||||
rescue
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def server.port
|
def server.port
|
||||||
|
|
Loading…
Reference in a new issue