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 | 7e7ca28d75bd27bd31dcb6431bce3227d81c113a (patch) | |
tree | 97689569e3573def99290b083a170fe123c092fa | |
parent | fb04c3dd5320927f78c9984bc66028b4259718e9 (diff) | |
download | ruby-7e7ca28d75bd27bd31dcb6431bce3227d81c113a.tar.gz ruby-7e7ca28d75bd27bd31dcb6431bce3227d81c113a.tar.xz ruby-7e7ca28d75bd27bd31dcb6431bce3227d81c113a.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@25518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/net/ftp.rb | 3 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Tue Oct 27 22:46:44 2009 NARUSE, Yui <naruse@ruby-lang.org> + + * 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] + Tue Oct 27 22:22:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/stringio/stringio.c (Init_stringio): added read_nonblock and diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 52bd37595..239bd3cbc 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 |