summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-04 01:33:58 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-04 01:33:58 +0000
commit096ffa2a633e7d78d773c9b8f487c5cb9170d7e1 (patch)
tree3d42976a39cc878f4720b1a9b1d8e6496c25315c
parent58a9bf0c4c2fc5aa70d4b1875ea59332191cf112 (diff)
* 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
-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