aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/ftp.rb6
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 <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