aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net/ftp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/ftp.rb')
-rw-r--r--lib/net/ftp.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index d1e545c0c8..610027dc38 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -634,9 +634,9 @@ module Net
while data = conn.read(blocksize)
yield(data)
end
- conn.shutdown(Socket::SHUT_WR)
+ conn.shutdown(Socket::SHUT_WR) rescue nil
conn.read_timeout = 1
- conn.read
+ conn.read rescue nil
ensure
conn.close if conn
end
@@ -659,9 +659,9 @@ module Net
while line = conn.gets
yield(line.sub(/\r?\n\z/, ""), !line.match(/\n\z/).nil?)
end
- conn.shutdown(Socket::SHUT_WR)
+ conn.shutdown(Socket::SHUT_WR) rescue nil
conn.read_timeout = 1
- conn.read
+ conn.read rescue nil
ensure
conn.close if conn
end
@@ -688,9 +688,9 @@ module Net
conn.write(buf)
yield(buf) if block_given?
end
- conn.shutdown(Socket::SHUT_WR)
+ conn.shutdown(Socket::SHUT_WR) rescue nil
conn.read_timeout = 1
- conn.read
+ conn.read rescue nil
ensure
conn.close if conn
end
@@ -724,9 +724,9 @@ module Net
conn.write(buf)
yield(buf) if block_given?
end
- conn.shutdown(Socket::SHUT_WR)
+ conn.shutdown(Socket::SHUT_WR) rescue nil
conn.read_timeout = 1
- conn.read
+ conn.read rescue nil
ensure
conn.close if conn
end