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

ruby-changes:15960

From: shugo <ko1@a...>
Date: Wed, 19 May 2010 23:22:28 +0900 (JST)
Subject: [ruby-changes:15960] Ruby:r27903 (trunk): * lib/net/imap.rb (disconnect): closes the socket of a Net::IMAP

shugo	2010-05-19 23:22:09 +0900 (Wed, 19 May 2010)

  New Revision: 27903

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

  Log:
    * lib/net/imap.rb (disconnect): closes the socket of a Net::IMAP
      object only when it is not closed.  [ruby-dev:41350]

  Modified files:
    trunk/ChangeLog
    trunk/lib/net/imap.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27902)
+++ ChangeLog	(revision 27903)
@@ -1,3 +1,8 @@
+Wed May 19 23:19:30 2010  Shugo Maeda  <shugo@r...>
+
+	* lib/net/imap.rb (disconnect): closes the socket of a Net::IMAP
+	  object only when it is not closed.  [ruby-dev:41350]
+
 Wed May 19 20:09:38 2010  Yusuke Endoh  <mame@t...>
 
 	* vm_eval.c (rb_f_caller): return [] instead of nil when the function
Index: lib/net/imap.rb
===================================================================
--- lib/net/imap.rb	(revision 27902)
+++ lib/net/imap.rb	(revision 27903)
@@ -311,7 +311,11 @@
         @receiver_thread.raise(e)
       end
       @receiver_thread.join
-      @sock.close
+      synchronize do
+        unless @sock.closed?
+          @sock.close 
+        end
+      end
       raise e if e
     end
 

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

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