diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/ftp.rb | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Wed Apr 4 10:33:31 2012 NARUSE, Yui <naruse@ruby-lang.org> + + * lib/ftp/ftp.rb (Net::FTP#close): ignore exceptions from shutdown and + read on closing. + Wed Apr 4 01:48:35 2012 NARUSE, Yui <naruse@ruby-lang.org> * lib/ftp/ftp.rb (Net::FTP#close): close socket more gracefully. diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 9a11515b2b..3dc1e2efb4 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -933,9 +933,9 @@ module Net # def close if @sock and not @sock.closed? - @sock.shutdown(Socket::SHUT_WR) - @sock.read_timeout = 1 - @sock.read + @sock.shutdown(Socket::SHUT_WR) rescue nil + @sock.read_timeout = 3 + @sock.read rescue nil @sock.close end end |