Bug feioso no UDP e possivelmente no TCP também.

This commit is contained in:
Diego Nehab
2004-05-28 07:24:43 +00:00
parent 9297b074d5
commit c98dc99199
14 changed files with 59 additions and 50 deletions

View File

@ -10,5 +10,5 @@ else
local wrap = mime.wrap()
convert = ltn12.filter.chain(base64, wrap)
end
source = ltn12.source.chain(source, convert)
repeat until not ltn12.pump(source, sink)
sink = ltn12.sink.chain(convert, sink)
ltn12.pump.all(source, sink)

View File

@ -4,6 +4,10 @@
-- Author: Diego Nehab
-- RCS ID: $Id$
-----------------------------------------------------------------------------
require"luasocket"
require"http"
socket.http.TIMEOUT = 10
cache = {}

View File

@ -4,6 +4,8 @@
-- Author: Diego Nehab
-- RCS ID: $Id$
-----------------------------------------------------------------------------
require"luasocket"
function get_status(sock, valid)
local line, err = sock:receive()
local code, par
@ -12,7 +14,7 @@ function get_status(sock, valid)
code = tonumber(code)
if code ~= valid then return code end
if code == 150 then
par = tonumber(socket.skip(2, string.find(line, "^%d%d%d (%d*)"))
par = tonumber(socket.skip(2, string.find(line, "^%d%d%d (%d*)")))
end
return nil, par
end

View File

@ -1,3 +1,5 @@
require("ltn12")
require("mime")
local convert
arg = arg or {}
local mode = arg and arg[1] or "-et"
@ -13,4 +15,4 @@ elseif mode == "-eb" then
else convert = mime.decode("quoted-printable") end
local source = ltn12.source.chain(ltn12.source.file(io.stdin), convert)
local sink = ltn12.sink.file(io.stdout)
ltn12.pump(source, sink)
ltn12.pump.all(source, sink)