diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-04 04:10:58 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-04 04:10:58 +0000 |
commit | 7865005fa1a42803124ecf5f0538c3753bc7f91c (patch) | |
tree | d9e9f4c716474086b656a1d14f281bd918b132dc /lib | |
parent | f0cd9107dfae482ca8b7d68f5fb834648f8bd50f (diff) | |
download | ruby-7865005fa1a42803124ecf5f0538c3753bc7f91c.tar.gz |
* lib/ftp/ftp.rb (Net::FTP#close): restore original read_timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/ftp.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 3dc1e2efb4..5be2981dd0 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -933,10 +933,14 @@ module Net # def close if @sock and not @sock.closed? - @sock.shutdown(Socket::SHUT_WR) rescue nil - @sock.read_timeout = 3 - @sock.read rescue nil - @sock.close + begin + @sock.shutdown(Socket::SHUT_WR) rescue nil + orig, self.read_timeout = self.read_timeout, 3 + @sock.read rescue nil + ensure + @sock.close + self.read_timeout = orig + end end end |