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.
This commit is contained in:
Diego Nehab 2004-10-12 22:35:20 +00:00
parent 396946b63a
commit 4964552718
4 changed files with 61 additions and 45 deletions

View file

@ -125,8 +125,10 @@ function metat.__index:send(sendt)
if string.find(code, "1..") then self.try(self.tp:check("2..")) end
-- done with data connection
self.data:close()
-- find out how many bytes were sent
local sent = socket.skip(1, self.data:getstats())
self.data = nil
return 1
return sent
end
function metat.__index:receive(recvt)
@ -186,9 +188,10 @@ local function tput(putt)
f:login(putt.user, putt.password)
if putt.type then f:type(putt.type) end
f:pasv()
f:send(putt)
local sent = f:send(putt)
f:quit()
return f:close()
f:close()
return sent
end
local default = {