diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-19 14:22:09 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-19 14:22:09 +0000 |
commit | f1ff36a331d41f1fb7712cae20cbad274ef30dea (patch) | |
tree | 7f08317005ae8dd77c9eb5d12606882c58e7260d | |
parent | 92b7ae2bcc9db315eb5262da1e7245e6f317e5ab (diff) | |
download | ruby-f1ff36a331d41f1fb7712cae20cbad274ef30dea.tar.gz |
* lib/net/imap.rb (disconnect): closes the socket of a Net::IMAP
object only when it is not closed. [ruby-dev:41350]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/imap.rb | 6 |
2 files changed, 10 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Wed May 19 23:19:30 2010 Shugo Maeda <shugo@ruby-lang.org> + + * 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@tsg.ne.jp> * vm_eval.c (rb_f_caller): return [] instead of nil when the function diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 0f6a4372d5..3404700297 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -311,7 +311,11 @@ module Net @receiver_thread.raise(e) end @receiver_thread.join - @sock.close + synchronize do + unless @sock.closed? + @sock.close + end + end raise e if e end |