mirror of
https://github.com/aria2/aria2.git
synced 2025-04-07 06:27:37 +03:00
Use std::unique_ptr for ValueBase object hierarchy
This commit is contained in:
parent
7a57ecc5f8
commit
7c06b903f3
77 changed files with 1242 additions and 1265 deletions
|
@ -68,15 +68,15 @@ void WebSocketSessionMan::removeSession
|
|||
void WebSocketSessionMan::addNotification
|
||||
(const std::string& method, const RequestGroup* group)
|
||||
{
|
||||
std::shared_ptr<Dict> dict = Dict::g();
|
||||
auto dict = Dict::g();
|
||||
dict->put("jsonrpc", "2.0");
|
||||
dict->put("method", method);
|
||||
std::shared_ptr<Dict> eventSpec = Dict::g();
|
||||
auto eventSpec = Dict::g();
|
||||
eventSpec->put("gid", GroupId::toHex((group->getGID())));
|
||||
std::shared_ptr<List> params = List::g();
|
||||
params->append(eventSpec);
|
||||
dict->put("params", params);
|
||||
std::string msg = json::encode(dict);
|
||||
auto params = List::g();
|
||||
params->append(std::move(eventSpec));
|
||||
dict->put("params", std::move(params));
|
||||
std::string msg = json::encode(dict.get());
|
||||
for(WebSocketSessions::const_iterator i = sessions_.begin(),
|
||||
eoi = sessions_.end(); i != eoi; ++i) {
|
||||
(*i)->addTextMessage(msg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue