diff options
author | moteus <mimir@newmail.ru> | 2013-05-30 11:01:07 +0400 |
---|---|---|
committer | moteus <mimir@newmail.ru> | 2013-05-30 11:01:07 +0400 |
commit | 00a06857c9c602285e21998e2a9dfef74ad8c525 (patch) | |
tree | d187642c7c34f1d88739d8d231b8df9b52c907d4 /test | |
parent | 5341131cd07bf4f66ce242980b5f3cfbbf45ea12 (diff) | |
download | luasocket-00a06857c9c602285e21998e2a9dfef74ad8c525.tar.gz luasocket-00a06857c9c602285e21998e2a9dfef74ad8c525.tar.bz2 luasocket-00a06857c9c602285e21998e2a9dfef74ad8c525.zip |
Fix. recive 2xx while ftp.get cause timeout error
In this example:
>Client send: MDTM test.txt
>Server response: 213 20120824120909
Because FTP server do not open new channel (2XX response)
and LuaSocket try open new channel we get timeout.
```lua
local ftp = require "socket.ftp"
local ltn12 = require "ltn12"
local url = require("socket.url")
local URL = "ftp://USER:TEST@127.0.0.1";
local CMD = 'MDTM test.txt';
-- get timeout
ftp.get{
url = URL;
command = CMD;
sink = ltn12.sink.table{};
}
-- or we can use ftp.command
ftp.command{
url = URL;
command = URL,
check = function(...)
local status, data = ...
return true
end;
}
```
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions