From 096ffa2a633e7d78d773c9b8f487c5cb9170d7e1 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 4 Apr 2012 01:33:58 +0000 Subject: [PATCH] * lib/ftp/ftp.rb (Net::FTP#close): ignore exceptions from shutdown and read on closing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/net/ftp.rb | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b0c6c2ae49..43ff432e91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Apr 4 10:33:31 2012 NARUSE, Yui + + * lib/ftp/ftp.rb (Net::FTP#close): ignore exceptions from shutdown and + read on closing. + Wed Apr 4 01:48:35 2012 NARUSE, Yui * 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