diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-19 04:19:35 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-19 04:19:35 +0000 |
commit | a257ea8d83c2ab277604b83b68d2c339e7315f3a (patch) | |
tree | 27bcbc91f4dfa98dcf8fb1dbe9b8b57157054dd6 /lib/net/ftp.rb | |
parent | 1dbb474935004fea05e233954990db966a16eb3d (diff) | |
download | ruby-a257ea8d83c2ab277604b83b68d2c339e7315f3a.tar.gz |
Shut down TLS connections gracefully.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/ftp.rb')
-rw-r--r-- | lib/net/ftp.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 60a59511ff..0ecd9a7e4f 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -1281,7 +1281,7 @@ module Net def close if @sock and not @sock.closed? begin - @bare_sock.shutdown(Socket::SHUT_WR) rescue nil + @sock.shutdown(Socket::SHUT_WR) rescue nil orig, self.read_timeout = self.read_timeout, 3 @sock.read rescue nil ensure @@ -1404,6 +1404,10 @@ module Net end def shutdown(*args) + if @io.respond_to?(:stop) + # shut down the TLS connection gracefully. + @io.stop + end @io.to_io.shutdown(*args) end |