projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Completed first version of JSON-RPC API
[project/luci.git]
/
modules
/
rpc
/
luasrc
/
jsonrpc.lua
diff --git
a/modules/rpc/luasrc/jsonrpc.lua
b/modules/rpc/luasrc/jsonrpc.lua
index
1c0db8b
..
71c95d5
100644
(file)
--- a/
modules/rpc/luasrc/jsonrpc.lua
+++ b/
modules/rpc/luasrc/jsonrpc.lua
@@
-44,9
+44,10
@@
function handle(tbl, rawsource, ...)
if stat then
if type(json.method) == "string"
and (not json.params or type(json.params) == "table") then
if stat then
if type(json.method) == "string"
and (not json.params or type(json.params) == "table") then
- if tbl[json.method] then
+ local method = resolve(tbl, json.method)
+ if method then
response = reply(json.jsonrpc, json.id,
response = reply(json.jsonrpc, json.id,
- proxy(
resolve(tbl, json.method)
, unpack(json.params or {})))
+ proxy(
method
, unpack(json.params or {})))
else
response = reply(json.jsonrpc, json.id,
nil, {code=-32601, message="Method not found."})
else
response = reply(json.jsonrpc, json.id,
nil, {code=-32601, message="Method not found."})
@@
-90,4
+91,4
@@
function proxy(method, ...)
return res
end
end
return res
end
end
-end
\ No newline at end of file
+end