diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-11-12 18:17:34 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-11-12 18:17:34 +0900 |
| commit | 2e5d9b056f2cf398d8996d93a4c7fbc1fbe66221 (patch) | |
| tree | 9f557267de4078108fd8ada3bfc1b8ec513c6f8a /src/DHTQueryMessage.cc | |
| parent | c4e66390acb285433a519ec8ee94f67bb7464bbf (diff) | |
Removed strconcat
Diffstat (limited to 'src/DHTQueryMessage.cc')
| -rw-r--r-- | src/DHTQueryMessage.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/DHTQueryMessage.cc b/src/DHTQueryMessage.cc index 61e3fba6..3f03fa97 100644 --- a/src/DHTQueryMessage.cc +++ b/src/DHTQueryMessage.cc @@ -68,20 +68,17 @@ bool DHTQueryMessage::isReply() const std::string DHTQueryMessage::toString() const { - std::string s = strconcat - ("dht query ", getMessageType(), - " TransactionID=", util::toHex(getTransactionID()), - " Remote:", getRemoteNode()->getIPAddress(), - ":", util::uitos(getRemoteNode()->getPort()), - ", id=", util::toHex(getRemoteNode()->getID(), DHT_ID_LENGTH), - ", "); - if(!getVersion().empty()) { - s += "v="; - s += util::torrentPercentEncode(getVersion()); - s += ", "; - } - s += toStringOptional(); - return s; + char buf[256]; + snprintf(buf, sizeof(buf), + "dht query %s TransactionID=%s Remote:%s(%u), id=%s, v=%s, %s", + getMessageType().c_str(), + util::toHex(getTransactionID()).c_str(), + getRemoteNode()->getIPAddress().c_str(), + getRemoteNode()->getPort(), + util::toHex(getRemoteNode()->getID(), DHT_ID_LENGTH).c_str(), + util::torrentPercentEncode(getVersion()).c_str(), + toStringOptional().c_str()); + return buf; } } // namespace aria2 |
