summaryrefslogtreecommitdiff
path: root/lib/net/imap.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/imap.rb')
-rw-r--r--lib/net/imap.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 547e23e618..59df778695 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -284,7 +284,11 @@ module Net
# Disconnects from the server.
def disconnect
- @sock.shutdown unless @usessl
+ if SSL::SSLSocket === @sock
+ @sock.io.shutdown
+ else
+ @sock.shutdown
+ end
@receiver_thread.join
@sock.close
end