44 if (method ==
"MachoResolveObject"){
45 _log(SERVICE__CALLS,
"%s::MachoResolveObject()",
GetName());
47 }
else if (method ==
"MachoBindObject") {
48 _log(SERVICE__CALLS,
"%s::MachoBindObject()",
GetName());
51 _log(SERVICE__CALLS,
"%s::%s()",
GetName(), method.c_str());
52 args.
Dump(SERVICE__CALL_TRACE);
72 CallMachoBindObject
args;
73 if (!args.Decode(&call.
tuple)) {
74 codelog( SERVICE__ERROR,
"%s Service: Failed to decode arguments",
GetName() );
78 _log( SERVICE__MESSAGE,
"%s Service: Processing MachoBindObject",
GetName() );
83 _log( SERVICE__ERROR,
"%s Service: Unable to create bound object:",
GetName());
84 args.bindParams->Dump(SERVICE__ERROR,
" ");
94 if (args.call->IsNone()) {
98 CallMachoBindObject_call boundcall;
99 if (!boundcall.Decode(&args.call)) {
100 codelog(SERVICE__ERROR,
"%s Service: Failed to decode boundcall arguments",
GetName());
104 _log(SERVICE__MESSAGE,
"%s Service: MachoBindObject also contains call to %s",
GetName(), boundcall.method_name.c_str());
106 PyCallArgs sub_args(call.
client, boundcall.arguments, boundcall.dict_arguments);
109 PyResult result = obj->
Call(boundcall.method_name, sub_args);
144 objectCaching_CachedMethodCallResult cached;
147 *in_result =
nullptr;
151 if (!result->
data()) {
152 _log( SERVICE__ERROR,
"%s: Failed to build cached return",
GetName() );
158 cached.call_return = result;
159 cached.sessionInfo = sessionInfo;
166 return cached.Encode();
171 _log( SERVICE__ERROR,
"Called default CreateBoundObject()");
#define _log(type, fmt,...)
PyService(PyServiceMgr *mgr, const char *serviceName)
const Buffer & content() const
Get the const PyBuffer content.
virtual PyResult Call(const std::string &method, PyCallArgs &args)
const char * GetName() const
PyObject * _BuildCachedReturn(PySubStream **result, const char *sessionInfo, CacheCheckTime check)
#define codelog(type, fmt,...)
void SetItem(size_t index, PyRep *object)
Stores Python object.
virtual PyResult Handle_MachoResolveObject(PyCallArgs &call)
virtual PyResult Handle_MachoBindObject(PyCallArgs &call)
PyServiceMgr *const m_manager
uint16 crc_hqx(const uint8 *data, size_t len, uint16 crc)
virtual PyResult Call(const std::string &method, PyCallArgs &args)
static const char *const s_checkTimeStrings[_checkCount]
virtual PyBoundObject * CreateBoundObject(Client *pClient, const PyRep *bind_args)
PySubStruct * BindObject(Client *pClient, PyBoundObject *pObj, PyDict *dict=nullptr, PyDict *oid=nullptr)
void Dump(LogType type) const
virtual PyResult Call(const std::string &method, PyCallArgs &args)