XmlRpc: Shortcurcuit mode (server and client are the same), *Draw: Fixed critical deadlock problem in FindIml

git-svn-id: svn://ultimatepp.org/upp/trunk@2202 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-03-09 18:57:53 +00:00
parent 50e36e842e
commit fa3441cfdf
5 changed files with 59 additions and 62 deletions

View file

@ -2,11 +2,28 @@
#define LLOG(x) // LOG(x)
XmlRpcCall::XmlRpcCall(const char *url)
{
shorted = true;
if(url && *url) {
server.URL(url);
shorted = false;
}
server.ContentType("text/xml");
timeout = 30000;
}
String XmlRpcExecute(const String& request, const char *group, const char *peeraddr);
Value XmlRpcCall::Execute()
{
String request = XmlHeader();
request << XmlTag("methodCall")(XmlTag("methodName")(method) + FormatXmlRpcParams(data.out));
String response = server.Post(request).TimeoutMsecs(timeout).ExecuteRedirect();
String response;
if(shorted)
response = XmlRpcExecute(request, "", "127.0.0.1");
else
response = server.Post(request).TimeoutMsecs(timeout).ExecuteRedirect();
LLOG("response: " << response);
if(IsNull(response)) {
LLOG("ERROR: " << server.GetError());