mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 09:52:34 +00:00
Merge pull request #2326
64ab8844
rpc_client: print destination host/port when failing to connect (moneromooo-monero)333f7012
http_client: add getters for host and port (moneromooo-monero)
This commit is contained in:
commit
65ee63e5bf
2 changed files with 6 additions and 3 deletions
|
@ -293,6 +293,9 @@ using namespace std;
|
|||
, m_lock()
|
||||
{}
|
||||
|
||||
const std::string &get_host() const { return m_host_buff; };
|
||||
const std::string &get_port() const { return m_port; };
|
||||
|
||||
bool set_server(const std::string& address, boost::optional<login> user)
|
||||
{
|
||||
http::url_content parsed{};
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace tools
|
|||
bool ok = connection.is_open();
|
||||
if (!ok)
|
||||
{
|
||||
fail_msg_writer() << "Couldn't connect to daemon";
|
||||
fail_msg_writer() << "Couldn't connect to daemon: " << m_http_client.get_host() << ":" << m_http_client.get_port();
|
||||
return false;
|
||||
}
|
||||
ok = ok && epee::net_utils::invoke_http_json_rpc("/json_rpc", method_name, req, res, m_http_client, t_http_connection::TIMEOUT());
|
||||
|
@ -98,7 +98,7 @@ namespace tools
|
|||
ok = ok && epee::net_utils::invoke_http_json_rpc("/json_rpc", method_name, req, res, m_http_client, t_http_connection::TIMEOUT());
|
||||
if (!ok)
|
||||
{
|
||||
fail_msg_writer() << "Couldn't connect to daemon";
|
||||
fail_msg_writer() << "Couldn't connect to daemon: " << m_http_client.get_host() << ":" << m_http_client.get_port();
|
||||
return false;
|
||||
}
|
||||
else if (res.status != CORE_RPC_STATUS_OK) // TODO - handle CORE_RPC_STATUS_BUSY ?
|
||||
|
@ -126,7 +126,7 @@ namespace tools
|
|||
ok = ok && epee::net_utils::invoke_http_json(relative_url, req, res, m_http_client, t_http_connection::TIMEOUT());
|
||||
if (!ok)
|
||||
{
|
||||
fail_msg_writer() << "Couldn't connect to daemon";
|
||||
fail_msg_writer() << "Couldn't connect to daemon: " << m_http_client.get_host() << ":" << m_http_client.get_port();
|
||||
return false;
|
||||
}
|
||||
else if (res.status != CORE_RPC_STATUS_OK) // TODO - handle CORE_RPC_STATUS_BUSY ?
|
||||
|
|
Loading…
Reference in a new issue