mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core/Rpc: Fixed 'shorted' mode
git-svn-id: svn://ultimatepp.org/upp/trunk@9874 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
b563c490ab
commit
cbc31ce7db
3 changed files with 43 additions and 40 deletions
|
|
@ -37,28 +37,28 @@ file
|
|||
config.h,
|
||||
Defs.h,
|
||||
Ops.h,
|
||||
Cpu.cpp optimize_speed,
|
||||
Cpu.cpp,
|
||||
Atomic.h,
|
||||
Mt.h,
|
||||
Mt.cpp,
|
||||
Heap.h,
|
||||
HeapImp.h,
|
||||
heaputil.cpp optimize_speed,
|
||||
sheap.cpp optimize_speed,
|
||||
lheap.cpp optimize_speed,
|
||||
heap.cpp optimize_speed,
|
||||
heapdbg.cpp optimize_speed,
|
||||
heaputil.cpp,
|
||||
sheap.cpp,
|
||||
lheap.cpp,
|
||||
heap.cpp,
|
||||
heapdbg.cpp,
|
||||
String.h,
|
||||
AString.hpp,
|
||||
StringFind.cpp optimize_speed,
|
||||
String.cpp optimize_speed,
|
||||
WString.cpp optimize_speed,
|
||||
StrUtil.cpp optimize_speed,
|
||||
StringFind.cpp,
|
||||
String.cpp,
|
||||
WString.cpp,
|
||||
StrUtil.cpp,
|
||||
SplitMerge.h,
|
||||
SplitMerge.cpp optimize_speed,
|
||||
SplitMerge.cpp,
|
||||
CharSet.i,
|
||||
CharSet.h,
|
||||
CharSet.cpp optimize_speed,
|
||||
CharSet.cpp,
|
||||
Bom.cpp,
|
||||
Path.h,
|
||||
Path.cpp,
|
||||
|
|
@ -66,9 +66,9 @@ file
|
|||
App.h,
|
||||
App.cpp,
|
||||
Stream.h,
|
||||
Stream.cpp optimize_speed,
|
||||
BlockStream.cpp optimize_speed,
|
||||
FileMapping.cpp optimize_speed,
|
||||
Stream.cpp,
|
||||
BlockStream.cpp,
|
||||
FileMapping.cpp,
|
||||
FilterStream.h,
|
||||
FilterStream.cpp,
|
||||
Profile.h,
|
||||
|
|
@ -77,8 +77,8 @@ file
|
|||
Debug.cpp,
|
||||
Util.h,
|
||||
Ini.cpp,
|
||||
Util.cpp optimize_speed,
|
||||
mathutil.cpp optimize_speed,
|
||||
Util.cpp,
|
||||
mathutil.cpp,
|
||||
Random.cpp,
|
||||
LocalProcess.h,
|
||||
LocalProcess.cpp,
|
||||
|
|
@ -94,12 +94,12 @@ file
|
|||
Vcont.h,
|
||||
BiCont.h,
|
||||
Vcont.hpp,
|
||||
Vcont.cpp optimize_speed,
|
||||
Vcont.cpp,
|
||||
Index.h,
|
||||
Map.h,
|
||||
FixedMap.h,
|
||||
Map.hpp,
|
||||
Hash.cpp optimize_speed,
|
||||
Hash.cpp,
|
||||
InVector.h,
|
||||
InVector.hpp,
|
||||
InMap.hpp,
|
||||
|
|
@ -112,25 +112,25 @@ file
|
|||
Callback.h,
|
||||
Concretes readonly separator,
|
||||
TimeDate.h,
|
||||
TimeDate.cpp optimize_speed,
|
||||
TimeDate.cpp,
|
||||
Value.h,
|
||||
Value.hpp,
|
||||
Value.cpp optimize_speed,
|
||||
Value.cpp,
|
||||
ValueUtil.h,
|
||||
ValueUtil.hpp,
|
||||
ValueUtil.cpp optimize_speed,
|
||||
ValueUtil.cpp,
|
||||
Complex.h,
|
||||
Format.h,
|
||||
Format.cpp optimize_speed,
|
||||
Format.cpp,
|
||||
Convert.h,
|
||||
Convert.cpp optimize_speed,
|
||||
Convert.cpp,
|
||||
Color.h,
|
||||
Color.cpp optimize_speed,
|
||||
Color.cpp,
|
||||
Gtypes.h,
|
||||
Gtypes.cpp optimize_speed,
|
||||
Gtypes.cpp,
|
||||
Language readonly separator,
|
||||
i18n.h,
|
||||
t.cpp optimize_speed,
|
||||
t.cpp,
|
||||
Core.t charset "UTF-8",
|
||||
t.h,
|
||||
Lang.h,
|
||||
|
|
@ -139,17 +139,17 @@ file
|
|||
lcid.txt,
|
||||
"Other files" readonly separator,
|
||||
Parser.h,
|
||||
parser.cpp optimize_speed,
|
||||
parser.cpp,
|
||||
XML.h,
|
||||
XML.cpp optimize_speed,
|
||||
XML.cpp,
|
||||
Xmlize.h,
|
||||
Xmlize.cpp optimize_speed,
|
||||
Xmlize.cpp,
|
||||
JSON.h,
|
||||
JSON.cpp optimize_speed,
|
||||
JSON.cpp,
|
||||
Uuid.h,
|
||||
Uuid.cpp optimize_speed,
|
||||
Uuid.cpp,
|
||||
Ptr.h,
|
||||
Ptr.cpp optimize_speed,
|
||||
Ptr.cpp,
|
||||
z.h,
|
||||
z.cpp,
|
||||
Topic.h,
|
||||
|
|
@ -158,8 +158,8 @@ file
|
|||
CoWork.h,
|
||||
CoWork.cpp,
|
||||
Hash.h,
|
||||
MD5.cpp optimize_speed,
|
||||
SHA1.cpp optimize_speed,
|
||||
MD5.cpp,
|
||||
SHA1.cpp,
|
||||
Web readonly separator,
|
||||
Inet.h,
|
||||
InetUtil.cpp,
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ Value JsonRpcData(const Value& v)
|
|||
return v;
|
||||
}
|
||||
|
||||
String RpcExecute(const String& request_);
|
||||
String RpcExecuteShorted(const String& request_);
|
||||
|
||||
RpcGet RpcRequest::Execute()
|
||||
{
|
||||
|
|
@ -131,7 +131,7 @@ RpcGet RpcRequest::Execute()
|
|||
String response;
|
||||
New();
|
||||
if(shorted)
|
||||
response = RpcExecute(request);
|
||||
response = RpcExecuteShorted(request);
|
||||
else
|
||||
response = Post(request).Execute();
|
||||
if(sLogRpcCalls) {
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ struct XmlRpcDo {
|
|||
String methodname;
|
||||
Value id;
|
||||
bool json;
|
||||
bool shorted;
|
||||
|
||||
String XmlResult();
|
||||
String DoXmlRpc();
|
||||
|
|
@ -119,6 +120,7 @@ struct XmlRpcDo {
|
|||
XmlRpcDo::XmlRpcDo(TcpSocket& http, const char *group)
|
||||
: http(http), group(group)
|
||||
{
|
||||
shorted = false;
|
||||
}
|
||||
|
||||
String XmlRpcDo::XmlResult()
|
||||
|
|
@ -152,7 +154,7 @@ String XmlRpcDo::DoXmlRpc()
|
|||
data.in = ParseXmlRpcParams(p);
|
||||
if(!CallRpcMethod(data, group, methodname, request))
|
||||
return FormatXmlRpcError(RPC_UNKNOWN_METHOD_ERROR, "\'" + methodname + "\' method is unknown");
|
||||
if(!data.rpc)
|
||||
if(!data.rpc && !shorted)
|
||||
return Null;
|
||||
return XmlResult();
|
||||
}
|
||||
|
|
@ -228,7 +230,7 @@ String XmlRpcDo::ProcessJsonRpc(const Value& v)
|
|||
data.in = param;
|
||||
try {
|
||||
if(CallRpcMethod(data, group, methodname, request)) {
|
||||
if(!data.rpc)
|
||||
if(!data.rpc && !shorted)
|
||||
return Null;
|
||||
return JsonResult();
|
||||
}
|
||||
|
|
@ -358,11 +360,12 @@ bool RpcPerform(TcpSocket& http, const char *group)
|
|||
return XmlRpcDo(http, group).Perform();
|
||||
}
|
||||
|
||||
String RpcExecute(const String& request_)
|
||||
String RpcExecuteShorted(const String& request_)
|
||||
{
|
||||
HttpRequest dummy;
|
||||
XmlRpcDo h(dummy, "");
|
||||
h.request = request_;
|
||||
h.shorted = true;
|
||||
h.data.peeraddr = "127.0.0.1";
|
||||
return h.RpcExecute();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue