From e240f93f2174d80040d381ef889fcefb48e8378e Mon Sep 17 00:00:00 2001 From: shugo Date: Sat, 8 May 2010 23:25:54 +0000 Subject: * lib/net/imap.rb (disconnect): terminates @receiver_thread even if @sock.shutdown raises an exception. [ruby-dev:34881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/imap.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/net/imap.rb') diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 46e8f201a1..0f6a4372d5 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -307,9 +307,12 @@ module Net end rescue Errno::ENOTCONN # ignore `Errno::ENOTCONN: Socket is not connected' on some platforms. + rescue Exception => e + @receiver_thread.raise(e) end @receiver_thread.join @sock.close + raise e if e end # Returns true if disconnected from the server. @@ -1012,7 +1015,10 @@ module Net @client_thread = Thread.current @receiver_thread = Thread.start { - receive_responses + begin + receive_responses + rescue Exception + end } end -- cgit v1.2.3