diff --git a/libresapi/src/api/ApiServer.cpp b/libresapi/src/api/ApiServer.cpp index 593e9386a..6efadeaf6 100644 --- a/libresapi/src/api/ApiServer.cpp +++ b/libresapi/src/api/ApiServer.cpp @@ -368,6 +368,9 @@ std::string ApiServer::handleRequest(Request &request) if(data.isRawData()) return data.getRawData(); + if(!resp.mCallbackName.empty()) + outstream << resource_api::makeKeyValueReference("callback_name", resp.mCallbackName); + outstream << resource_api::makeKeyValue("debug_msg", debugString.str()); outstream << resource_api::makeKeyValueReference("returncode", returncode); if(!resp.mStateToken.isNull()) diff --git a/libresapi/src/api/ApiTypes.h b/libresapi/src/api/ApiTypes.h index c443eb170..6d6d5c746 100644 --- a/libresapi/src/api/ApiTypes.h +++ b/libresapi/src/api/ApiTypes.h @@ -252,6 +252,9 @@ public: StateToken mStateToken; + //Just for GUI benefit + std::string mCallbackName; + // the result StreamBase& mDataStream; diff --git a/libresapi/src/api/ResourceRouter.cpp b/libresapi/src/api/ResourceRouter.cpp index a13201a27..48050cdb6 100644 --- a/libresapi/src/api/ResourceRouter.cpp +++ b/libresapi/src/api/ResourceRouter.cpp @@ -37,6 +37,13 @@ ResponseTask* ResourceRouter::handleRequest(Request& req, Response& resp) if(vit->first == req.mPath.top()) { req.mPath.pop(); + + //Just for GUI benefit + std::string callbackName; + req.mStream << makeKeyValueReference("callback_name", callbackName); + resp.mCallbackName = callbackName; + // + return vit->second->handleRequest(req, resp); } }