aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/ftp.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 52bd37595d..239bd3cbc6 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -132,6 +132,7 @@ module Net
@passive = false
@debug_mode = false
@resume = false
+ @sock = nil
if host
connect(host)
if user
@@ -143,7 +144,7 @@ module Net
def binary=(newmode)
if newmode != @binary
@binary = newmode
- @binary ? voidcmd("TYPE I") : voidcmd("TYPE A")
+ @binary ? voidcmd("TYPE I") : voidcmd("TYPE A") unless closed?
end
end