diff options
-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 |