From 8910412068c32512693bc0a88cb5bcf626052f77 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 9 Jan 2015 10:28:16 -0500 Subject: [PATCH] pass results by reference --- I2PControl.cpp | 6 +++--- I2PControl.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/I2PControl.cpp b/I2PControl.cpp index 6529c0e1..18fe469b 100644 --- a/I2PControl.cpp +++ b/I2PControl.cpp @@ -171,7 +171,7 @@ namespace client // handlers - void I2PControlService::AuthenticateHandler (const std::map& params, std::map results) + void I2PControlService::AuthenticateHandler (const std::map& params, std::map& results) { const std::string& api = params.at (I2P_CONTROL_PARAM_API); const std::string& password = params.at (I2P_CONTROL_PARAM_PASSWORD); @@ -180,14 +180,14 @@ namespace client results[I2P_CONTROL_PARAM_TOKEN] = boost::lexical_cast(i2p::util::GetSecondsSinceEpoch ()); } - void I2PControlService::EchoHandler (const std::map& params, std::map results) + void I2PControlService::EchoHandler (const std::map& params, std::map& results) { const std::string& echo = params.at (I2P_CONTROL_PARAM_ECHO); LogPrint (eLogDebug, "I2PControl Echo Echo=", echo); results[I2P_CONTROL_PARAM_RESULT] = echo; } - void I2PControlService::RouterInfoHandler (const std::map& params, std::map results) + void I2PControlService::RouterInfoHandler (const std::map& params, std::map& results) { } } diff --git a/I2PControl.h b/I2PControl.h index 59174f29..f203466d 100644 --- a/I2PControl.h +++ b/I2PControl.h @@ -59,9 +59,9 @@ namespace client private: - void AuthenticateHandler (const std::map& params, std::map results); - void EchoHandler (const std::map& params, std::map results); - void RouterInfoHandler (const std::map& params, std::map results); + void AuthenticateHandler (const std::map& params, std::map& results); + void EchoHandler (const std::map& params, std::map& results); + void RouterInfoHandler (const std::map& params, std::map& results); private: @@ -71,7 +71,7 @@ namespace client boost::asio::io_service m_Service; boost::asio::ip::tcp::acceptor m_Acceptor; - typedef void (I2PControlService::*MethodHandler)(const std::map& params, std::map results); + typedef void (I2PControlService::*MethodHandler)(const std::map& params, std::map& results); std::map m_MethodHanders; }; }