mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 22:26:52 -05:00
Added name of requests to be used by GUI
This commit is contained in:
parent
ae95b49f8a
commit
39967b7ce7
libresapi/src/api
@ -368,6 +368,9 @@ std::string ApiServer::handleRequest(Request &request)
|
|||||||
if(data.isRawData())
|
if(data.isRawData())
|
||||||
return data.getRawData();
|
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::makeKeyValue("debug_msg", debugString.str());
|
||||||
outstream << resource_api::makeKeyValueReference("returncode", returncode);
|
outstream << resource_api::makeKeyValueReference("returncode", returncode);
|
||||||
if(!resp.mStateToken.isNull())
|
if(!resp.mStateToken.isNull())
|
||||||
|
@ -252,6 +252,9 @@ public:
|
|||||||
|
|
||||||
StateToken mStateToken;
|
StateToken mStateToken;
|
||||||
|
|
||||||
|
//Just for GUI benefit
|
||||||
|
std::string mCallbackName;
|
||||||
|
|
||||||
// the result
|
// the result
|
||||||
StreamBase& mDataStream;
|
StreamBase& mDataStream;
|
||||||
|
|
||||||
|
@ -37,6 +37,13 @@ ResponseTask* ResourceRouter::handleRequest(Request& req, Response& resp)
|
|||||||
if(vit->first == req.mPath.top())
|
if(vit->first == req.mPath.top())
|
||||||
{
|
{
|
||||||
req.mPath.pop();
|
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);
|
return vit->second->handleRequest(req, resp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user