Changeset 6410

Show
Ignore:
Timestamp:
11/09/10 20:43:13 (3 years ago)
Author:
jow
Message:

libs/core: restore original implementation of copcall() and coxpcall(), solves issues with RPC UCI endpoint

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/core/luasrc/util.lua

    r6366 r6410  
    788788 
    789789-- Handle return value of protected call 
    790 function handleReturnValue(err, co, status, arg1, arg2, arg3, arg4, arg5) 
     790function handleReturnValue(err, co, status, ...) 
    791791    if not status then 
    792         return false, err(debug.traceback(co, arg1), arg1, arg2, arg3, arg4, arg5) 
     792        return false, err(debug.traceback(co, (...)), ...) 
    793793    end 
    794794 
    795795    if coroutine.status(co) ~= 'suspended' then 
    796         return true, arg1, arg2, arg3, arg4, arg5 
    797     end 
    798  
    799     return performResume(err, co, coroutine.yield(arg1, arg2, arg3, arg4, arg5)) 
     796        return true, ... 
     797    end 
     798 
     799    return performResume(err, co, coroutine.yield(...)) 
    800800end 
    801801 
    802802-- Resume execution of protected function call 
    803 function performResume(err, co, arg1, arg2, arg3, arg4, arg5) 
    804     return handleReturnValue(err, co, coroutine.resume(co, arg1, arg2, arg3, arg4, arg5)) 
    805 end 
     803function performResume(err, co, ...) 
     804    return handleReturnValue(err, co, coroutine.resume(co, ...)) 
     805end