epee: update 'http_server_handlers_map2.h' macros to use fully qualified names

quick patch which fixes the issue where if you use some macros from `http_server_handlers_map2.h` you have to be in the `epee` namespace or it doesn't compile. Now can remove `using namespace epee;` from header file `core_rpc_server.h`, which caused a couple of name qualifying mistakes
This commit is contained in:
Jeffrey Ryan 2022-05-22 23:41:41 -05:00
parent 97271b7d20
commit a4cb77f9f3
4 changed files with 6 additions and 10 deletions

View file

@ -71,7 +71,7 @@
else if((query_info.m_URI == s_pattern) && (cond)) \ else if((query_info.m_URI == s_pattern) && (cond)) \
{ \ { \
handled = true; \ handled = true; \
uint64_t ticks = misc_utils::get_tick_count(); \ uint64_t ticks = epee::misc_utils::get_tick_count(); \
boost::value_initialized<command_type::request> req; \ boost::value_initialized<command_type::request> req; \
bool parse_res = epee::serialization::load_t_from_json(static_cast<command_type::request&>(req), query_info.m_body); \ bool parse_res = epee::serialization::load_t_from_json(static_cast<command_type::request&>(req), query_info.m_body); \
if (!parse_res) \ if (!parse_res) \
@ -107,7 +107,7 @@
else if(query_info.m_URI == s_pattern) \ else if(query_info.m_URI == s_pattern) \
{ \ { \
handled = true; \ handled = true; \
uint64_t ticks = misc_utils::get_tick_count(); \ uint64_t ticks = epee::misc_utils::get_tick_count(); \
boost::value_initialized<command_type::request> req; \ boost::value_initialized<command_type::request> req; \
bool parse_res = epee::serialization::load_t_from_binary(static_cast<command_type::request&>(req), epee::strspan<uint8_t>(query_info.m_body)); \ bool parse_res = epee::serialization::load_t_from_binary(static_cast<command_type::request&>(req), epee::strspan<uint8_t>(query_info.m_body)); \
if (!parse_res) \ if (!parse_res) \
@ -117,7 +117,7 @@
response_info.m_response_comment = "Bad request"; \ response_info.m_response_comment = "Bad request"; \
return true; \ return true; \
} \ } \
uint64_t ticks1 = misc_utils::get_tick_count(); \ uint64_t ticks1 = epee::misc_utils::get_tick_count(); \
boost::value_initialized<command_type::response> resp;\ boost::value_initialized<command_type::response> resp;\
MINFO(m_conn_context << "calling " << s_pattern); \ MINFO(m_conn_context << "calling " << s_pattern); \
bool res = false; \ bool res = false; \
@ -129,7 +129,7 @@
response_info.m_response_comment = "Internal Server Error"; \ response_info.m_response_comment = "Internal Server Error"; \
return true; \ return true; \
} \ } \
uint64_t ticks2 = misc_utils::get_tick_count(); \ uint64_t ticks2 = epee::misc_utils::get_tick_count(); \
epee::byte_slice buffer; \ epee::byte_slice buffer; \
epee::serialization::store_t_to_binary(static_cast<command_type::response&>(resp), buffer, 64 * 1024); \ epee::serialization::store_t_to_binary(static_cast<command_type::response&>(resp), buffer, 64 * 1024); \
uint64_t ticks3 = epee::misc_utils::get_tick_count(); \ uint64_t ticks3 = epee::misc_utils::get_tick_count(); \

View file

@ -83,7 +83,7 @@ uint16_t parse_public_rpc_port(const po::variables_map &vm)
} }
uint16_t rpc_port; uint16_t rpc_port;
if (!string_tools::get_xtype_from_string(rpc_port, rpc_port_str)) if (!epee::string_tools::get_xtype_from_string(rpc_port, rpc_port_str))
{ {
throw std::runtime_error("invalid RPC port " + rpc_port_str); throw std::runtime_error("invalid RPC port " + rpc_port_str);
} }

View file

@ -1063,7 +1063,7 @@ bool t_rpc_command_executor::print_transaction(crypto::hash transaction_hash,
cryptonote::blobdata blob; cryptonote::blobdata blob;
std::string source = as_hex.empty() ? pruned_as_hex + prunable_as_hex : as_hex; std::string source = as_hex.empty() ? pruned_as_hex + prunable_as_hex : as_hex;
bool pruned = !pruned_as_hex.empty() && prunable_as_hex.empty(); bool pruned = !pruned_as_hex.empty() && prunable_as_hex.empty();
if (!string_tools::parse_hexstr_to_binbuff(source, blob)) if (!epee::string_tools::parse_hexstr_to_binbuff(source, blob))
{ {
tools::fail_msg_writer() << "Failed to parse tx to get json format"; tools::fail_msg_writer() << "Failed to parse tx to get json format";
} }

View file

@ -47,10 +47,6 @@
#undef MONERO_DEFAULT_LOG_CATEGORY #undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "daemon.rpc" #define MONERO_DEFAULT_LOG_CATEGORY "daemon.rpc"
// yes, epee doesn't properly use its full namespace when calling its
// functions from macros. *sigh*
using namespace epee;
namespace cryptonote namespace cryptonote
{ {
/************************************************************************/ /************************************************************************/