mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-12 22:03:31 +02:00
Bug feioso no UDP e possivelmente no TCP também.
This commit is contained in:
@ -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)
|
||||
|
@ -4,6 +4,10 @@
|
||||
-- Author: Diego Nehab
|
||||
-- RCS ID: $Id$
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
require"luasocket"
|
||||
require"http"
|
||||
|
||||
socket.http.TIMEOUT = 10
|
||||
|
||||
cache = {}
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user