diff options
Diffstat (limited to 'src/ftp.lua')
-rw-r--r-- | src/ftp.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ftp.lua b/src/ftp.lua index 43c62c2..9902c88 100644 --- a/src/ftp.lua +++ b/src/ftp.lua | |||
@@ -125,8 +125,10 @@ function metat.__index:send(sendt) | |||
125 | if string.find(code, "1..") then self.try(self.tp:check("2..")) end | 125 | if string.find(code, "1..") then self.try(self.tp:check("2..")) end |
126 | -- done with data connection | 126 | -- done with data connection |
127 | self.data:close() | 127 | self.data:close() |
128 | -- find out how many bytes were sent | ||
129 | local sent = socket.skip(1, self.data:getstats()) | ||
128 | self.data = nil | 130 | self.data = nil |
129 | return 1 | 131 | return sent |
130 | end | 132 | end |
131 | 133 | ||
132 | function metat.__index:receive(recvt) | 134 | function metat.__index:receive(recvt) |
@@ -186,9 +188,10 @@ local function tput(putt) | |||
186 | f:login(putt.user, putt.password) | 188 | f:login(putt.user, putt.password) |
187 | if putt.type then f:type(putt.type) end | 189 | if putt.type then f:type(putt.type) end |
188 | f:pasv() | 190 | f:pasv() |
189 | f:send(putt) | 191 | local sent = f:send(putt) |
190 | f:quit() | 192 | f:quit() |
191 | return f:close() | 193 | f:close() |
194 | return sent | ||
192 | end | 195 | end |
193 | 196 | ||
194 | local default = { | 197 | local default = { |