1
0
Fork 0
forked from lthn/blockchain

extended logs for other proxy helpers

This commit is contained in:
cryptozoidberg 2020-03-07 07:38:37 +01:00
parent 12b2bec9bd
commit afe15b3337
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
2 changed files with 25 additions and 5 deletions

View file

@ -136,7 +136,13 @@ namespace tools
epee::net_utils::parse_url(m_daemon_address, u);
if (!u.port)
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)

View file

@ -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)
{
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)
{
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([&](){
#ifdef MOBILE_WALLET_BUILD
LOG_PRINT_L0("[INVOKE_JSON] --->" << typeid(t_request).name() )
LOG_PRINT_L0("[INVOKE_JSON_URL] --->" << typeid(t_request).name() )
#endif
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
LOG_PRINT_L0("[INVOKE_JSON] <---" << typeid(t_request).name())
LOG_PRINT_L0("[INVOKE_JSON_URL] <---" << typeid(t_request).name())
#endif
return r;
});