diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftp.lua | 15 | ||||
| -rw-r--r-- | src/ltn12.lua | 3 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/ftp.lua b/src/ftp.lua index 917cd89..e0c3cae 100644 --- a/src/ftp.lua +++ b/src/ftp.lua | |||
| @@ -271,8 +271,17 @@ _M.command = socket.protect(function(cmdt) | |||
| 271 | local f = _M.open(cmdt.host, cmdt.port, cmdt.create) | 271 | local f = _M.open(cmdt.host, cmdt.port, cmdt.create) |
| 272 | f:greet() | 272 | f:greet() |
| 273 | f:login(cmdt.user, cmdt.password) | 273 | f:login(cmdt.user, cmdt.password) |
| 274 | f.try(f.tp:command(cmdt.command, cmdt.argument)) | 274 | if type(cmdt.command) == "table" then |
| 275 | if cmdt.check then f.try(f.tp:check(cmdt.check)) end | 275 | local argument = cmdt.argument or {} |
| 276 | local check = cmdt.check or {} | ||
| 277 | for i,cmd in ipairs(cmdt.command) do | ||
| 278 | f.try(f.tp:command(cmd, argument[i])) | ||
| 279 | if check[i] then f.try(f.tp:check(check[i])) end | ||
| 280 | end | ||
| 281 | else | ||
| 282 | f.try(f.tp:command(cmdt.command, cmdt.argument)) | ||
| 283 | if cmdt.check then f.try(f.tp:check(cmdt.check)) end | ||
| 284 | end | ||
| 276 | f:quit() | 285 | f:quit() |
| 277 | return f:close() | 286 | return f:close() |
| 278 | end) | 287 | end) |
| @@ -282,4 +291,4 @@ _M.get = socket.protect(function(gett) | |||
| 282 | else return tget(gett) end | 291 | else return tget(gett) end |
| 283 | end) | 292 | end) |
| 284 | 293 | ||
| 285 | return _M \ No newline at end of file | 294 | return _M |
diff --git a/src/ltn12.lua b/src/ltn12.lua index dede0fa..575c5a7 100644 --- a/src/ltn12.lua +++ b/src/ltn12.lua | |||
| @@ -22,6 +22,9 @@ _M.source = source | |||
| 22 | _M.sink = sink | 22 | _M.sink = sink |
| 23 | _M.pump = pump | 23 | _M.pump = pump |
| 24 | 24 | ||
| 25 | local unpack = unpack or table.unpack | ||
| 26 | local select = base.select | ||
| 27 | |||
| 25 | -- 2048 seems to be better in windows... | 28 | -- 2048 seems to be better in windows... |
| 26 | _M.BLOCKSIZE = 2048 | 29 | _M.BLOCKSIZE = 2048 |
| 27 | _M._VERSION = "LTN12 1.0.3" | 30 | _M._VERSION = "LTN12 1.0.3" |
