diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-20 01:44:07 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-20 01:44:07 +0000 |
commit | f0dd33d5498f16acdaa6e96edf0a3707ff963bbc (patch) | |
tree | c5392438066d2694ebff0b34c5bfe5afec0d30ed /lib | |
parent | 279deb60518f71f4206fff26410c6432bd5de5cb (diff) |
shutdown(2) should not be called for SSLSocket.
SSLSocket#stop is a private method and cannot be called, but explicit calls
are not necessary because SSL_shutdown() is called from SSLSocket#close.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/ftp.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index f439795e96..b3ebaf68af 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -1406,11 +1406,13 @@ module Net end def shutdown(*args) - if @io.respond_to?(:stop) - # shut down the TLS connection gracefully. - @io.stop + if defined?(OpenSSL::SSL::SSLSocket) && + @io.is_a?(OpenSSL::SSL::SSLSocket) + # If @io is an SSLSocket, SSL_shutdown() will be called from + # SSLSocket#close, so shutdown(2) should not be called. + else + @io.shutdown(*args) end - @io.to_io.shutdown(*args) end def read(len = nil) |