luasocket ftp always times out
i've success 's tcp facility, nonetheless i'm carrying problem the ftp module. i always timeout perplexing collect (small) file. i download record only glorious controlling firefox ftp pacifist mode (on ubuntu athletic linux).
i guess competence i need luasocket pacifist ftp, nonetheless following i found seems default. record i'm perplexing collect around ftp accessed pacifist ftp around programs machine, nonetheless around active mode. i found "hacking" pacifist mode support luasocket, contention implies after versions stopped controlling pacifist mode, nonetheless chronicle seems pacifist anyway (i'm controlling 2.0.1; newest 2.0.2 does seem have any changes applicable case). i'm small confused post competence news situation, partly since it's unequivocally aged luasocket's source bears small likeness formula discussion).
i've boiled formula down this:
local ftp = need "socket.ftp"
ftp.timeout = 10
print(ftp.get("ftp://ftp.us.dell.com/app/dpart.txt"))
this gives me timeout. i ran underneath strace linux (same ptrace solaris). here's an abridged transcript:
socket(pf_inet, sock_stream, ipproto_ip) = 3
fcntl64(3, f_setfl, o_rdwr|o_nonblock) = 0
recv(3, "230-welcome dell ftp site."..., 8192, 0) = 971
send(3, "pasv\r\n", 6, 0) = 6
recv(3, 0x8089a58, 8192, 0) = -1 eagain (resource temporarily unavailable)
select(4, [3], null, null, {9, 999934}) = 0 (timeout)
there's another site i attempted joining to, nonetheless evidence i can't post here, nonetheless box law rather different...i got snippet above nonetheless select() unbroken during end, following this:
recv(3, "227 entering pacifist mode (123,456,789,0,12,34)\r\n", 8192, 0) = 49
socket(pf_inet, sock_stream, ipproto_ip) = 4
fcntl64(4, f_setfl, o_rdwr|o_nonblock) = 0
connect(4, {sa_family=af_inet, sin_port=htons(12345), sin_addr=inet_addr("123.456.789.0")}, 16) = -1 einprogress (operation progress)
select(5, [4], [4], null, {9, 999694}) = 0 (timeout)
compare snippet "ftp" way pacifist mode (which works fine, nonetheless note does set sockets nonblocking luasocket does):
socket(pf_inet, sock_stream, ipproto_ip) = 6
write(5, "pasv\r\n", 6) = 6
read(3, "227 entering pacifist mode (123,456,789,0,12,34)\r\n", 1024) = 51
connect(6, {sa_family=af_inet, sin_port=htons(12345), sin_addr=inet_addr("123.456.789.0")}, 16) = 0
so i've attempted luasocket opposing twin opposite ftp sites opposite nonetheless identical failures. i also attempted another accessory where active ftp works, didn't have any improved fitness there (presumably since luasocket always controlling pacifist mode, i tell reading source socket/ftp.lua).
so anyone here luasocket two-liner during tip work? note machine, active ftp dell's site doesn't work (i bond nonetheless shortly i ls disconnects), luasocket work greatfully also note presumably active ftp dell's site another way works your machine.
Comments
Post a Comment