X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2FXMLRPC.java;h=607d34e6f5d3c88d7be088e3add5fe37bc80091e;hb=707b1064f56e88db0cf555a99cb4aa224484f51a;hp=5d88d6c99242198651aea04152c6fcf930fc0391;hpb=ccf0715e9a34f491fa2c52f5f1ba90fd371b7c51;p=org.ibex.core.git diff --git a/src/org/ibex/XMLRPC.java b/src/org/ibex/XMLRPC.java index 5d88d6c..607d34e 100644 --- a/src/org/ibex/XMLRPC.java +++ b/src/org/ibex/XMLRPC.java @@ -31,9 +31,15 @@ import org.bouncycastle.util.encoders.Base64; */ class XMLRPC extends JS { - public XMLRPC(String url, String method) { this(url, method, new HTTP(url)); } - public XMLRPC(String url, String method, HTTP http) { this.http = http; this.url = url; this.method = method; } - public Object get(Object name) { return new XMLRPC(url, (method.equals("") ? "" : method + ".") + name.toString(), http); } + public XMLRPC(String url, String method) { + this.http = url.startsWith("stdio:") ? HTTP.stdio : new HTTP(url); + this.url = url; + this.method = method; + } + public XMLRPC(String url, String method, XMLRPC httpSource) { + this.http = httpSource.http; this.url = url; this.method = method; } + public Object get(Object name) { + return new XMLRPC(url, (method.equals("") ? "" : method + ".") + name.toString(), this); } /** this holds character content as we read it in -- since there is only one per instance, we don't support mixed content */ @@ -165,9 +171,9 @@ class XMLRPC extends JS { content.append("\r\n"); content.append("\n"); content.append(" \n"); - content.append(" "); + content.append(" "); content.append(method); - content.append("\n"); + content.append("\n"); content.append(" \n"); for(int i=0; i\n"); @@ -313,11 +319,11 @@ class XMLRPC extends JS { final void call(final JS.UnpauseCallback callback, final JSArray args) { try { - if (Log.verbose) Log.info(this, "call to " + url + " : " + method); + if (Log.rpc) Log.info(this, "call to " + url + " : " + method); if (tracker == null) tracker = new Hash(); if (objects == null) objects = new Vec(); String request = buildRequest(args); - if (Log.verbose) Log.info(this, "send:\n" + request); + if (Log.rpc) Log.info(this, "send:\n" + request); InputStream is = http.POST("text/xml", request); BufferedReader br = new BufferedReader(new InputStreamReader(is)); try {