summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-09 10:24:32 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-09 10:24:32 +0000
commitf67887c18e3cec3d912bef65852aa6caa1e7682e (patch)
treeea118019027f3916e7406797b1b9ff827687d29c /lib
parent182f7e163f3943ab45fe63f7c732b3bfb1a26d3b (diff)
merge revision(s) 18368:
* lib/net/imap.rb (disconnect): do not refer SSL::SSLSocket for environments without OpenSSL. backported from trunk. fixed [ruby-dev:35755]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@21409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/imap.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index f8c0d3be4c..6162ffa0d0 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -284,9 +284,11 @@ module Net
# Disconnects from the server.
def disconnect
- if SSL::SSLSocket === @sock
+ begin
+ # try to call SSL::SSLSocket#io.
@sock.io.shutdown
- else
+ rescue NoMethodError
+ # @sock is not an SSL::SSLSocket.
@sock.shutdown
end
@receiver_thread.join