Little bug in manual.

This commit is contained in:
Diego Nehab 2004-11-17 04:55:57 +00:00
parent 3700bf65b7
commit bdc3e241bb
3 changed files with 27 additions and 3 deletions

View File

@ -122,7 +122,7 @@ smtp.<b>send{</b><br>
&nbsp;&nbsp;[user = <i>string</i>,]<br>
&nbsp;&nbsp;[password = <i>string</i>,]<br>
&nbsp;&nbsp;[server = <i>string</i>,]<br>
&nbsp;&nbsp;[port = <i>string</i>,]<br>
&nbsp;&nbsp;[port = <i>number</i>,]<br>
&nbsp;&nbsp;[domain = <i>string</i>,]<br>
&nbsp;&nbsp;[step = <i>LTN12 pump step</i>,]<br>
<b>}</b>

View File

@ -31,6 +31,7 @@ function filter.cycle(low, ctx, extra)
end
end
--[[
local function chain2(f1, f2)
local ff1, ff2 = "", ""
return function(chunk)
@ -55,6 +56,29 @@ local function chain2(f1, f2)
end
end
end
]]
local function chain2(f1, f2)
local co = coroutine.create(function(chunk)
while true do
local filtered1 = f1(chunk)
local filtered2 = f2(filtered1)
local done2 = filtered1 and ""
while true do
if filtered2 == "" or filtered2 == nil then break end
coroutine.yield(filtered2)
filtered2 = f2(done2)
end
if filtered1 == "" then chunk = coroutine.yield(filtered1)
elseif filtered1 == nil then return nil
else chunk = chunk and "" end
end
end)
return function(chunk)
local _, res = coroutine.resume(co, chunk)
return res
end
end
-- chains a bunch of filters together
function filter.chain(...)

View File

@ -187,7 +187,7 @@ local function cleanup_qptest()
end
-- create test file
function create_b64test()
local function create_b64test()
local f = assert(io.open(b64test, "wb"))
local t = {}
for j = 1, 100 do
@ -282,8 +282,8 @@ end
local t = socket.gettime()
identity_test()
create_b64test()
identity_test()
encode_b64test()
decode_b64test()
compare_b64test()