diff --git a/ChangeLog b/ChangeLog index 8d9d0978a8..01509e3e1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 5 16:33:20 2008 Shugo Maeda + + * lib/net/imap.rb (disconnect): do not refer SSL::SSLSocket for + environments without OpenSSL. backported from trunk. + 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 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