forked from lthn/blockchain
extended logs for other proxy helpers
This commit is contained in:
parent
12b2bec9bd
commit
afe15b3337
2 changed files with 25 additions and 5 deletions
|
|
@ -136,7 +136,13 @@ namespace tools
|
||||||
epee::net_utils::parse_url(m_daemon_address, u);
|
epee::net_utils::parse_url(m_daemon_address, u);
|
||||||
if (!u.port)
|
if (!u.port)
|
||||||
u.port = 8081;
|
u.port = 8081;
|
||||||
return m_http_client.connect(u.host, std::to_string(u.port), m_connection_timeout);
|
bool r = m_http_client.connect(u.host, std::to_string(u.port), m_connection_timeout);
|
||||||
|
if (r)
|
||||||
|
{
|
||||||
|
m_plast_daemon_is_disconnected = false;
|
||||||
|
m_last_success_interract_time = time(nullptr);
|
||||||
|
}
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------------------------------------
|
||||||
bool default_http_core_proxy::call_COMMAND_RPC_GET_ALL_ALIASES(currency::COMMAND_RPC_GET_ALL_ALIASES::response& res)
|
bool default_http_core_proxy::call_COMMAND_RPC_GET_ALL_ALIASES(currency::COMMAND_RPC_GET_ALL_ALIASES::response& res)
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,14 @@ namespace tools
|
||||||
inline bool invoke_http_json_rpc_update_is_disconnect(const std::string& method_name, const t_request& req, t_response& res)
|
inline bool invoke_http_json_rpc_update_is_disconnect(const std::string& method_name, const t_request& req, t_response& res)
|
||||||
{
|
{
|
||||||
return call_request([&](){
|
return call_request([&](){
|
||||||
return epee::net_utils::invoke_http_json_rpc("/json_rpc", method_name, req, res, m_http_client);
|
#ifdef MOBILE_WALLET_BUILD
|
||||||
|
LOG_PRINT_L0("[INVOKE_JSON_METHOD] ---> " << method_name)
|
||||||
|
#endif
|
||||||
|
bool r = epee::net_utils::invoke_http_json_rpc("/json_rpc", method_name, req, res, m_http_client);
|
||||||
|
#ifdef MOBILE_WALLET_BUILD
|
||||||
|
LOG_PRINT_L0("[INVOKE_JSON_METHOD] <---" << method_name)
|
||||||
|
#endif
|
||||||
|
return r;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,7 +95,14 @@ namespace tools
|
||||||
inline bool invoke_http_bin_remote_command2_update_is_disconnect(const std::string& url, const t_request& req, t_response& res)
|
inline bool invoke_http_bin_remote_command2_update_is_disconnect(const std::string& url, const t_request& req, t_response& res)
|
||||||
{
|
{
|
||||||
return call_request([&](){
|
return call_request([&](){
|
||||||
return epee::net_utils::invoke_http_bin_remote_command2(m_daemon_address + url, req, res, m_http_client, m_connection_timeout);
|
#ifdef MOBILE_WALLET_BUILD
|
||||||
|
LOG_PRINT_L0("[INVOKE_BIN] --->" << typeid(t_request).name())
|
||||||
|
#endif
|
||||||
|
bool r = epee::net_utils::invoke_http_bin_remote_command2(m_daemon_address + url, req, res, m_http_client, m_connection_timeout);
|
||||||
|
#ifdef MOBILE_WALLET_BUILD
|
||||||
|
LOG_PRINT_L0("[INVOKE_BIN] <---" << typeid(t_request).name())
|
||||||
|
#endif
|
||||||
|
return r;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,11 +111,11 @@ namespace tools
|
||||||
{
|
{
|
||||||
return call_request([&](){
|
return call_request([&](){
|
||||||
#ifdef MOBILE_WALLET_BUILD
|
#ifdef MOBILE_WALLET_BUILD
|
||||||
LOG_PRINT_L0("[INVOKE_JSON] --->" << typeid(t_request).name() )
|
LOG_PRINT_L0("[INVOKE_JSON_URL] --->" << typeid(t_request).name() )
|
||||||
#endif
|
#endif
|
||||||
bool r = epee::net_utils::invoke_http_json_remote_command2(m_daemon_address + url, req, res, m_http_client, m_connection_timeout);
|
bool r = epee::net_utils::invoke_http_json_remote_command2(m_daemon_address + url, req, res, m_http_client, m_connection_timeout);
|
||||||
#ifdef MOBILE_WALLET_BUILD
|
#ifdef MOBILE_WALLET_BUILD
|
||||||
LOG_PRINT_L0("[INVOKE_JSON] <---" << typeid(t_request).name())
|
LOG_PRINT_L0("[INVOKE_JSON_URL] <---" << typeid(t_request).name())
|
||||||
#endif
|
#endif
|
||||||
return r;
|
return r;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue