From 49f7b3e8d1c45dd99970dd91472543bb7fb157b7 Mon Sep 17 00:00:00 2001 From: shugo Date: Tue, 5 Aug 2008 07:24:48 +0000 Subject: [PATCH] * lib/net/imap.rb (disconnect): do not refer SSL::SSLSocket for environments without OpenSSL. fixed [ruby-dev:35755]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/net/imap.rb | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e35ed05330..f1e82de1e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 5 16:13:05 2008 Shugo Maeda + + * lib/net/imap.rb (disconnect): do not refer SSL::SSLSocket for + environments without OpenSSL. fixed [ruby-dev:35755]. + Tue Aug 5 14:19:22 2008 Nobuyoshi Nakada * file.c (rb_stat_mode): generalized st_mode mask. diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 4c63ddd325..64011e69cc 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -287,9 +287,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