diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-11-12 19:24:38 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-11-12 19:24:38 +0900 |
| commit | 0da2468d6b4ed4ef9f96cd3d50aa6e02da863da0 (patch) | |
| tree | 4790558d314e6ceb774a095e8144f20480017084 /src/LpdMessageDispatcher.cc | |
| parent | 2e5d9b056f2cf398d8996d93a4c7fbc1fbe66221 (diff) | |
Removed strappend
Diffstat (limited to 'src/LpdMessageDispatcher.cc')
| -rw-r--r-- | src/LpdMessageDispatcher.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/LpdMessageDispatcher.cc b/src/LpdMessageDispatcher.cc index fcbfd2b3..9ab36e2a 100644 --- a/src/LpdMessageDispatcher.cc +++ b/src/LpdMessageDispatcher.cc @@ -107,13 +107,15 @@ std::string createLpdRequest (const std::string& multicastAddress, uint16_t multicastPort, const std::string& infoHash, uint16_t port) { - std::string req = "BT-SEARCH * HTTP/1.1\r\n"; - strappend(req, "Host: ", multicastAddress, A2STR::COLON_C, - util::uitos(multicastPort), A2STR::CRLF); - strappend(req, "Port: ", util::uitos(port), A2STR::CRLF); - strappend(req, "Infohash: ", util::toHex(infoHash), A2STR::CRLF); - req += "\r\n\r\n"; - return req; + return fmt("BT-SEARCH * HTTP/1.1\r\n" + "Host: %s:%u\r\n" + "Port: %u\r\n" + "Infohash: %s\r\n" + "\r\n\r\n", + multicastAddress.c_str(), + multicastPort, + port, + util::toHex(infoHash).c_str()); } } // namespace bittorrent |
