aboutsummaryrefslogtreecommitdiff
path: root/src/ftp.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-10-12 22:35:20 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-10-12 22:35:20 +0000
commit4964552718b81dba2c36fc08494aefae89a799f4 (patch)
tree5473a82045a7f66f31c56f4cbd151b16a61e7e90 /src/ftp.lua
parent396946b63a95fc9949b75aed82c7ac1c132ccd40 (diff)
downloadluasocket-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.lua9
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
130end 132end
131 133
132function metat.__index:receive(recvt) 134function 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
192end 195end
193 196
194local default = { 197local default = {