summaryrefslogtreecommitdiff
path: root/jsonrpc/request.esp
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-10-03 02:38:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:32 -0500
commit4b17a6dfbbc2d6adafbc9103b97fd78c43c2efe4 (patch)
tree194fd7ac339189aecea2514c28be65048d3787f4 /jsonrpc/request.esp
parent71ec249e0291462e9a1ffce3c888289e4c796aa7 (diff)
downloadsamba-4b17a6dfbbc2d6adafbc9103b97fd78c43c2efe4.tar.gz
samba-4b17a6dfbbc2d6adafbc9103b97fd78c43c2efe4.tar.bz2
samba-4b17a6dfbbc2d6adafbc9103b97fd78c43c2efe4.zip
r19055: JSON-RPC is working! It passes the small qooxdoo JSON-RPC test suite
perfectly. This check in covers the remaining fixes and enhancements to complete the server. In a subsequent check-in, I need to learn about the new qooxdoo packaging mechanism. Although it'd be nice to have the whole source tree, that's huge and needn't be in samba svn. It's now supposed to be very easy to package qooxdoo, so I'll figure out how that's done and then check in the relevant small number of files. Steps after that involve generating the stubs to allow various ejs functions to be called via JSON-RPC. Derrell (This used to be commit 5bfebbda7a5d28d4deb31c54a8feb24c4416cbf6)
Diffstat (limited to 'jsonrpc/request.esp')
-rw-r--r--jsonrpc/request.esp15
1 files changed, 5 insertions, 10 deletions
diff --git a/jsonrpc/request.esp b/jsonrpc/request.esp
index 984ee4663e..5a1408df62 100644
--- a/jsonrpc/request.esp
+++ b/jsonrpc/request.esp
@@ -209,14 +209,14 @@ function _JsonRpcError_create(origin, code, message)
function _origin(origin)
{
- this.origin = origin;
+ this.data.origin = origin;
}
o.setOrigin = _origin;
function _setError(code, message)
{
- this.code = code;
- this.message = message;
+ this.data.code = code;
+ this.data.message = message;
}
o.setError = _setError;
@@ -236,7 +236,7 @@ function _JsonRpcError_create(origin, code, message)
{
var error = this;
var id = this.id;
- var ret = new Array(2);
+ var ret = new Object();
ret.error = this.data;
ret.id = this.id;
sendReply(Json.encode(ret), this.scriptTransportId);
@@ -444,12 +444,7 @@ error.setOrigin(jsonrpc.Constant.ErrorOrigin.Application);
var retval = method(jsonInput.params, error);
/* See if the result of the function was actually an error object */
-var wasError = (retval["__type"] != undefined);
-if (wasError)
-{
- wasError = retval.__type == "_JsonRpcError";
-}
-if (wasError)
+if (retval["__type"] == "_JsonRpcError")
{
/* Yup, it was. Return the error */
retval.Send();