зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
58a9bf0c4c
Коммит
096ffa2a63
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче