diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-03-30 12:58:22 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-03-30 13:02:02 +0200 |
commit | b0151de60144ddc1f56d253e7574bd6a9aefa28f (patch) | |
tree | 4e87da719ff11ccfa61798f3bd07d42574cc9c22 /contrib/epee | |
parent | Merge pull request #247 (diff) | |
parent | Restore daemon interactive mode (diff) | |
download | monero-b0151de60144ddc1f56d253e7574bd6a9aefa28f.tar.xz |
Merge pull request #248
a0590d2 Restore daemon interactive mode (Thomas Winget)
Diffstat (limited to 'contrib/epee')
-rw-r--r-- | contrib/epee/include/console_handler.h | 12 | ||||
-rw-r--r-- | contrib/epee/include/net/http_server_handlers_map2.h | 8 |
2 files changed, 11 insertions, 9 deletions
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h index 147fd9ce0..fc8cc3841 100644 --- a/contrib/epee/include/console_handler.h +++ b/contrib/epee/include/console_handler.h @@ -269,17 +269,19 @@ namespace epee string_tools::trim(command); LOG_PRINT_L2("Read command: " << command); - if(0 == command.compare("exit") || 0 == command.compare("q")) - { - continue_handle = false; - }else if (command.empty()) + if (command.empty()) { continue; } else if(cmd_handler(command)) { continue; - } else + } + else if(0 == command.compare("exit") || 0 == command.compare("q")) + { + continue_handle = false; + } + else { std::cout << "unknown command: " << command << std::endl; std::cout << usage; diff --git a/contrib/epee/include/net/http_server_handlers_map2.h b/contrib/epee/include/net/http_server_handlers_map2.h index 201460130..f812077f1 100644 --- a/contrib/epee/include/net/http_server_handlers_map2.h +++ b/contrib/epee/include/net/http_server_handlers_map2.h @@ -65,7 +65,7 @@ CHECK_AND_ASSERT_MES(parse_res, false, "Failed to parse json: \r\n" << query_info.m_body); \ uint64_t ticks1 = epee::misc_utils::get_tick_count(); \ boost::value_initialized<command_type::response> resp;\ - if(!callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), m_conn_context)) \ + if(!callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp))) \ { \ LOG_ERROR("Failed to " << #callback_f << "()"); \ response_info.m_response_code = 500; \ @@ -90,7 +90,7 @@ CHECK_AND_ASSERT_MES(parse_res, false, "Failed to parse bin body data, body size=" << query_info.m_body.size()); \ uint64_t ticks1 = misc_utils::get_tick_count(); \ boost::value_initialized<command_type::response> resp;\ - if(!callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), m_conn_context)) \ + if(!callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp))) \ { \ LOG_ERROR("Failed to " << #callback_f << "()"); \ response_info.m_response_code = 500; \ @@ -173,7 +173,7 @@ epee::json_rpc::error_response fail_resp = AUTO_VAL_INIT(fail_resp); \ fail_resp.jsonrpc = "2.0"; \ fail_resp.id = req.id; \ - if(!callback_f(req.params, resp.result, fail_resp.error, m_conn_context)) \ + if(!callback_f(req.params, resp.result, fail_resp.error)) \ { \ epee::serialization::store_t_to_json(static_cast<epee::json_rpc::error_response&>(fail_resp), response_info.m_body); \ return true; \ @@ -202,7 +202,7 @@ else if(callback_name == method_name) \ { \ PREPARE_OBJECTS_FROM_JSON(command_type) \ - if(!callback_f(req.params, resp.result, m_conn_context)) \ + if(!callback_f(req.params, resp.result)) \ { \ epee::json_rpc::error_response fail_resp = AUTO_VAL_INIT(fail_resp); \ fail_resp.jsonrpc = "2.0"; \ |