diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-10-12 22:35:20 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-10-12 22:35:20 +0000 |
commit | 4964552718b81dba2c36fc08494aefae89a799f4 (patch) | |
tree | 5473a82045a7f66f31c56f4cbd151b16a61e7e90 /src/ftp.lua | |
parent | 396946b63a95fc9949b75aed82c7ac1c132ccd40 (diff) | |
download | luasocket-4964552718b81dba2c36fc08494aefae89a799f4.tar.gz luasocket-4964552718b81dba2c36fc08494aefae89a799f4.tar.bz2 luasocket-4964552718b81dba2c36fc08494aefae89a799f4.zip |
My own ltn12.filter.chain is done.
Implemented part of DB's suggestion for ftp.
Mimetest.lua generates the test file for base64 instead of loading from disk.
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 = { |