diff options
author | Diego Nehab <diego.nehab@gmail.com> | 2013-04-17 19:38:21 -0700 |
---|---|---|
committer | Diego Nehab <diego.nehab@gmail.com> | 2013-04-17 19:38:21 -0700 |
commit | c28fa1d3093e40e3cde365641755544003c83877 (patch) | |
tree | 731268dfb640681372bd66ce2f5d44cbeacda41c /etc | |
parent | 00435529bb9a3a6614e9934fe20c27ada3dc2283 (diff) | |
parent | 33b4f0cfc7f0a0ebd5d4aaf9bbfe88a02d4368e7 (diff) | |
download | luasocket-c28fa1d3093e40e3cde365641755544003c83877.tar.gz luasocket-c28fa1d3093e40e3cde365641755544003c83877.tar.bz2 luasocket-c28fa1d3093e40e3cde365641755544003c83877.zip |
Merge pull request #27 from catwell/pull-noarg
fix more uses of arg
Diffstat (limited to 'etc')
-rw-r--r-- | etc/dispatch.lua | 5 |
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} |