diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2022-07-15 14:13:39 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2022-12-12 11:54:20 +0100 |
commit | 96c791dd20fea54c17d224000dee677bc158f66a (patch) | |
tree | 97fdcc0db13d7a7dd2b76040d2402e8c2e9b32a4 /src/i2p.cpp | |
parent | 944a9de08a00f8273e73cd28b40e46cc0eb0bad1 (diff) |
net: remove CService::ToString() use ToStringAddrPort() instead
Both methods do the same thing, so simplify to having just one.
`ToString()` is too generic in this case and it is unclear what it does,
given that there are similar methods:
`ToStringAddr()` (inherited from `CNetAddr`),
`ToStringPort()` and
`ToStringAddrPort()`.
Diffstat (limited to 'src/i2p.cpp')
-rw-r--r-- | src/i2p.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/i2p.cpp b/src/i2p.cpp index 9778ef8b76..5355e0166c 100644 --- a/src/i2p.cpp +++ b/src/i2p.cpp @@ -233,7 +233,7 @@ bool Session::Connect(const CService& to, Connection& conn, bool& proxy_error) throw std::runtime_error(strprintf("\"%s\"", connect_reply.full)); } catch (const std::runtime_error& e) { - Log("Error connecting to %s: %s", to.ToString(), e.what()); + Log("Error connecting to %s: %s", to.ToStringAddrPort(), e.what()); CheckControlSock(); return false; } @@ -302,7 +302,7 @@ std::unique_ptr<Sock> Session::Hello() const } if (!ConnectSocketDirectly(m_control_host, *sock, nConnectTimeout, true)) { - throw std::runtime_error(strprintf("Cannot connect to %s", m_control_host.ToString())); + throw std::runtime_error(strprintf("Cannot connect to %s", m_control_host.ToStringAddrPort())); } SendRequestAndGetReply(*sock, "HELLO VERSION MIN=3.1 MAX=3.1"); @@ -371,7 +371,7 @@ void Session::CreateIfNotCreatedAlready() const auto session_type = m_transient ? "transient" : "persistent"; const auto session_id = GetRandHash().GetHex().substr(0, 10); // full is overkill, too verbose in the logs - Log("Creating %s SAM session %s with %s", session_type, session_id, m_control_host.ToString()); + Log("Creating %s SAM session %s with %s", session_type, session_id, m_control_host.ToStringAddrPort()); auto sock = Hello(); @@ -408,7 +408,7 @@ void Session::CreateIfNotCreatedAlready() Log("%s SAM session %s created, my address=%s", Capitalize(session_type), m_session_id, - m_my_addr.ToString()); + m_my_addr.ToStringAddrPort()); } std::unique_ptr<Sock> Session::StreamAccept() |