diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/imap.rb | 6 |
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 |