diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index 193c168c9..6b4e96caa 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -157,14 +157,14 @@ int main(int argc, char* argv[]) uint32_t rpc_ip; uint16_t rpc_port; - if (!epee::string_tools::get_xtype_from_string(rpc_ip, rpc_ip_str)) + if (!epee::string_tools::get_ip_int32_from_string(rpc_ip, rpc_ip_str)) { - std::cerr << "Invalid IP" << std::endl; + std::cerr << "Invalid IP: " << rpc_ip_str << std::endl; return 1; } if (!epee::string_tools::get_xtype_from_string(rpc_port, rpc_port_str)) { - std::cerr << "Invalid port" << std::endl; + std::cerr << "Invalid port: " << rpc_port_str << std::endl; return 1; } diff --git a/src/daemon/http_connection.h b/src/daemon/http_connection.h index 1f4e837a6..4e0a2abdf 100644 --- a/src/daemon/http_connection.h +++ b/src/daemon/http_connection.h @@ -1,5 +1,6 @@ #pragma once +#include "string_tools.h" #include "net/http_client.h" namespace daemonize { @@ -19,7 +20,7 @@ public: : mp_http_client(p_http_client) { // TODO fix http client so that it accepts properly typed arguments - std::string ip_str = boost::lexical_cast(ip); + std::string ip_str = epee::string_tools::get_ip_string_from_int32(ip); std::string port_str = boost::lexical_cast(port); m_ok = mp_http_client->connect(ip_str, port_str, TIMEOUT); } diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 98f6a3a76..b8a792289 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -44,7 +44,7 @@ namespace { { std::string result = "http://" - + boost::lexical_cast(host) + + epee::string_tools::get_ip_string_from_int32(host) + ":" + boost::lexical_cast(port) + relative_url;