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

ruby-changes:23698

From: naruse <ko1@a...>
Date: Mon, 21 May 2012 17:48:44 +0900 (JST)
Subject: [ruby-changes:23698] naruse:r35749 (trunk): Rescue exception from writing to a socket.

naruse	2012-05-21 17:48:32 +0900 (Mon, 21 May 2012)

  New Revision: 35749

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

  Log:
    Rescue exception from writing to a socket.
    
    conn.print may raise EPIPE because ftp.retrbinary closes the connection
    because of read_timeout. but the exact result varies from the situation
    like platform, timing, and so on.
    it may raise ECONNRESET, ECONNABORTED, EOFError, or nothing raised.

  Modified files:
    trunk/test/net/ftp/test_ftp.rb

Index: test/net/ftp/test_ftp.rb
===================================================================
--- test/net/ftp/test_ftp.rb	(revision 35748)
+++ test/net/ftp/test_ftp.rb	(revision 35749)
@@ -392,7 +392,7 @@
       sleep(0.1)
       conn.print(binary_data[0,1024])
       sleep(0.5)
-      assert_raise(Errno::EPIPE){ conn.print(binary_data[1024, 1024]) }
+      conn.print(binary_data[1024, 1024]) rescue nil # may raise EPIPE or something
       conn.close
       sock.print("226 Transfer complete.\r\n")
     }

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

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