diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-27 13:50:42 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-27 13:50:42 +0000 |
commit | 249569fd8e6ba2c10082ab3eaaff6d1230998f01 (patch) | |
tree | 97689569e3573def99290b083a170fe123c092fa /lib/net | |
parent | 8252adfd5a6020a8b3dad173f71e9012ba5c6acf (diff) | |
download | ruby-249569fd8e6ba2c10082ab3eaaff6d1230998f01.tar.gz |
* lib/net/ftp.rb (Net::FTP#initialize): @sock = nil.
* lib/net/ftp.rb (Net::FTP#binary=): send command only when
socket is open. [ruby-dev:39548]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/ftp.rb | 3 |
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 |