diff options
author | Diego Nehab <diego.nehab@gmail.com> | 2013-05-30 03:02:33 -0700 |
---|---|---|
committer | Diego Nehab <diego.nehab@gmail.com> | 2013-05-30 03:02:33 -0700 |
commit | 802567b7deff65b0b8471ae4ba5c7873caef525f (patch) | |
tree | 20325872b0c926c9b63bad0cd6d55cd10bc9d474 /src | |
parent | ebde49944b1ba06153fe31a1ad92aaebf6e053e2 (diff) | |
parent | 00a06857c9c602285e21998e2a9dfef74ad8c525 (diff) | |
download | luasocket-802567b7deff65b0b8471ae4ba5c7873caef525f.tar.gz luasocket-802567b7deff65b0b8471ae4ba5c7873caef525f.tar.bz2 luasocket-802567b7deff65b0b8471ae4ba5c7873caef525f.zip |
Merge pull request #49 from moteus/moteus-ftp-get-2xx
Fix. recive 2xx while ftp.get cause timeout error
Diffstat (limited to 'src')
-rw-r--r-- | src/ftp.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ftp.lua b/src/ftp.lua index 714b388..ea1145b 100644 --- a/src/ftp.lua +++ b/src/ftp.lua | |||
@@ -142,7 +142,11 @@ function metat.__index:receive(recvt) | |||
142 | if argument == "" then argument = nil end | 142 | if argument == "" then argument = nil end |
143 | local command = recvt.command or "retr" | 143 | local command = recvt.command or "retr" |
144 | self.try(self.tp:command(command, argument)) | 144 | self.try(self.tp:command(command, argument)) |
145 | local code = self.try(self.tp:check{"1..", "2.."}) | 145 | local code,reply = self.try(self.tp:check{"1..", "2.."}) |
146 | if (code >= 200) and (code <= 299) then | ||
147 | recvt.sink(reply) | ||
148 | return 1 | ||
149 | end | ||
146 | if not self.pasvt then self:portconnect() end | 150 | if not self.pasvt then self:portconnect() end |
147 | local source = socket.source("until-closed", self.data) | 151 | local source = socket.source("until-closed", self.data) |
148 | local step = recvt.step or ltn12.pump.step | 152 | local step = recvt.step or ltn12.pump.step |