[前][次][番号順一覧][スレッド一覧]

ruby-changes:36284

From: akr <ko1@a...>
Date: Mon, 10 Nov 2014 23:40:15 +0900 (JST)
Subject: [ruby-changes:36284] akr:r48365 (trunk): * test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore

akr	2014-11-10 23:40:00 +0900 (Mon, 10 Nov 2014)

  New Revision: 48365

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48365

  Log:
    * test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore
      exceptions on server thread.
      Delete read_timeout method call to fix NoMethodError.

  Modified files:
    trunk/ChangeLog
    trunk/test/net/ftp/test_ftp.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48364)
+++ ChangeLog	(revision 48365)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Nov 10 23:34:13 2014  Tanaka Akira  <akr@f...>
+
+	* 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@r...>
 
 	* win32/win32.c (rb_w32_read): retry with reduced length if cannot to
Index: test/net/ftp/test_ftp.rb
===================================================================
--- test/net/ftp/test_ftp.rb	(revision 48364)
+++ test/net/ftp/test_ftp.rb	(revision 48365)
@@ -773,20 +773,16 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/ftp/test_ftp.rb#L773
   def create_ftp_server(sleep_time = nil)
     server = TCPServer.new(SERVER_ADDR, 0)
     @thread = Thread.start do
+      if sleep_time
+        sleep(sleep_time)
+      end
+      sock = server.accept
       begin
-        if sleep_time
-          sleep(sleep_time)
-        end
-        sock = server.accept
-        begin
-          yield(sock)
-          sock.shutdown(Socket::SHUT_WR)
-          sock.read_timeout = 1
-          sock.read unless sock.eof?
-        ensure
-          sock.close
-        end
-      rescue
+        yield(sock)
+        sock.shutdown(Socket::SHUT_WR)
+        sock.read unless sock.eof?
+      ensure
+        sock.close
       end
     end
     def server.port

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]