Core: LoadFile checks whether path is a file (because POSIX opens a dir too), Core/Rpc: StopRpcServerTrace

git-svn-id: svn://ultimatepp.org/upp/trunk@5546 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-11-13 07:53:32 +00:00
parent 75e26144c8
commit f5b00a9481
4 changed files with 641 additions and 632 deletions

View file

@ -341,6 +341,7 @@ struct JsonRpcRequestNamed : RpcRequest {
void LogRpcRequests(bool b = true);
void SetRpcServerTrace(Stream& s, int level = 1);
void StopRpcServerTrace();
#include "legacy.h"

View file

@ -55,6 +55,11 @@ void SetRpcServerTrace(Stream& s, int level)
rpc_trace_level = level;
}
void StopRpcServerTrace()
{
rpc_trace = NULL;
}
bool CallRpcMethod(RpcData& data, const char *group, String methodname)
{
LLOG("method name: " << methodname);

View file

@ -1,4 +1,3 @@
#ifndef _Core_Rpc_icpp_init_stub
#define _Core_Rpc_icpp_init_stub
#include "Web/init"
#endif

View file

@ -1496,9 +1496,13 @@ String LoadStream(Stream& in) {
}
String LoadFile(const char *filename) {
FindFile ff(filename);
if(ff && ff.IsFile()) {
FileIn in(filename);
return LoadStream(in);
}
return String::GetVoid();
}
bool SaveStream(Stream& out, const String& data) {
if(!out.IsOpen() || out.IsError()) return false;