aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/dispatch.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/etc/dispatch.lua b/etc/dispatch.lua
index 31a1290..cab7f59 100644
--- a/etc/dispatch.lua
+++ b/etc/dispatch.lua
@@ -50,7 +50,7 @@ function socket.protect(f)
50 return function(...) 50 return function(...)
51 local co = coroutine.create(f) 51 local co = coroutine.create(f)
52 while true do 52 while true do
53 local results = {coroutine.resume(co, base.unpack(arg))} 53 local results = {coroutine.resume(co, ...)}
54 local status = table.remove(results, 1) 54 local status = table.remove(results, 1)
55 if not status then 55 if not status then
56 if base.type(results[1]) == 'table' then 56 if base.type(results[1]) == 'table' then
@@ -104,8 +104,7 @@ local function cowrap(dispatcher, tcp, error)
104 -- don't override explicitly. 104 -- don't override explicitly.
105 local metat = { __index = function(table, key) 105 local metat = { __index = function(table, key)
106 table[key] = function(...) 106 table[key] = function(...)
107 arg[1] = tcp 107 return tcp[key](tcp,select(2,...))
108 return tcp[key](base.unpack(arg))
109 end 108 end
110 return table[key] 109 return table[key]
111 end} 110 end}