diff --git a/include/opendht/value.h b/include/opendht/value.h index 64c5220628ad600f72e4134794deda4c7b69dfde..ae8776f4ac8cd7fff46d5b7ac8675b05845d1532 100644 --- a/include/opendht/value.h +++ b/include/opendht/value.h @@ -475,7 +475,7 @@ struct OPENDHT_PUBLIC Value OPENDHT_PUBLIC friend std::ostream& operator<< (std::ostream& s, const Value& v); inline std::string toString() const { - std::stringstream ss; + std::ostringstream ss; ss << *this; return ss.str(); } @@ -774,7 +774,7 @@ struct OPENDHT_PUBLIC Select } std::string toString() const { - std::stringstream ss; + std::ostringstream ss; ss << *this; return ss.str(); } @@ -897,7 +897,7 @@ struct OPENDHT_PUBLIC Where } std::string toString() const { - std::stringstream ss; + std::ostringstream ss; ss << *this; return ss.str(); } @@ -963,7 +963,7 @@ struct OPENDHT_PUBLIC Query void msgpack_unpack(const msgpack::object& o); std::string toString() const { - std::stringstream ss; + std::ostringstream ss; ss << *this; return ss.str(); } diff --git a/src/callbacks.cpp b/src/callbacks.cpp index ecda4057af4b459ff194bf6a9107079f551c9307..b98ab5f961b818517d664b4f39e1163a3075e724 100644 --- a/src/callbacks.cpp +++ b/src/callbacks.cpp @@ -92,7 +92,7 @@ bindDoneCbSimple(DoneCallbackSimpleRaw raw_cb, void* user_data) { std::string NodeStats::toString() const { - std::stringstream ss; + std::ostringstream ss; ss << "Known nodes: " << good_nodes << " good, " << dubious_nodes << " dubious, " << incoming_nodes << " incoming." << std::endl; ss << searches << " searches, " << node_cache_size << " total cached nodes" << std::endl; if (table_depth > 1) { diff --git a/src/dht.cpp b/src/dht.cpp index bcdfb69ba98699d5eb44db6eaef2da875e2c6343..126c685028e08eb323c6b221ceca02deaa463e6b 100644 --- a/src/dht.cpp +++ b/src/dht.cpp @@ -1642,7 +1642,7 @@ Dht::dumpSearch(const Search& sr, std::ostream& out) const void Dht::dumpTables() const { - std::stringstream out; + std::ostringstream out; out << "My id " << myid << std::endl; out << "Buckets IPv4 :" << std::endl; @@ -1694,7 +1694,7 @@ Dht::getStorageLog(const InfoHash& h) const { auto s = store.find(h); if (s == store.end()) { - std::stringstream out; + std::ostringstream out; out << "Storage " << h << " empty" << std::endl; return out.str(); } @@ -1704,7 +1704,7 @@ Dht::getStorageLog(const InfoHash& h) const std::string Dht::printStorageLog(const decltype(store)::value_type& s) const { - std::stringstream out; + std::ostringstream out; using namespace std::chrono; const auto& st = s.second; out << "Storage " << s.first << " " @@ -1723,7 +1723,7 @@ Dht::printStorageLog(const decltype(store)::value_type& s) const std::string Dht::getRoutingTablesLog(sa_family_t af) const { - std::stringstream out; + std::ostringstream out; for (const auto& b : buckets(af)) dumpBucket(b, out); return out.str(); @@ -1732,7 +1732,7 @@ Dht::getRoutingTablesLog(sa_family_t af) const std::string Dht::getSearchesLog(sa_family_t af) const { - std::stringstream out; + std::ostringstream out; auto num_searches = dht4.searches.size() + dht6.searches.size(); if (num_searches > 8) { if (not af or af == AF_INET) @@ -1757,7 +1757,7 @@ Dht::getSearchesLog(sa_family_t af) const std::string Dht::getSearchLog(const InfoHash& id, sa_family_t af) const { - std::stringstream out; + std::ostringstream out; if (af == AF_UNSPEC) { out << getSearchLog(id, AF_INET) << getSearchLog(id, AF_INET6); } else { diff --git a/src/dht_proxy_server.cpp b/src/dht_proxy_server.cpp index 8fd771cc3e10a7fcc49e4a2526411714acb612b5..7ac9a48a4bed81f3d2a2e27a9dd92d36f1b1beeb 100644 --- a/src/dht_proxy_server.cpp +++ b/src/dht_proxy_server.cpp @@ -704,7 +704,7 @@ DhtProxyServer::get(restinio::request_handle_t request, initHttpResponse(request->create_response<ResponseByParts>())); response->flush(); dht_->get(infoHash, [this, response](const std::vector<Sp<Value>>& values) { - std::stringstream output; + std::ostringstream output; for (const auto& value : values) { output << Json::writeString(jsonBuilder_, value->toJson()) << "\n"; } diff --git a/src/dhtrunner.cpp b/src/dhtrunner.cpp index f687fdd7cfb850c357a343c707e5251f872d2062..449e0380b80e700ebb3112ec9d01e1582362ef87 100644 --- a/src/dhtrunner.cpp +++ b/src/dhtrunner.cpp @@ -1088,6 +1088,7 @@ DhtRunner::setProxyServer(const std::string& proxy, const std::string& pushNodeI #else if (not proxy.empty()) throw std::runtime_error("DHT proxy requested but OpenDHT built without proxy support."); + (void) pushNodeId; #endif } diff --git a/src/http.cpp b/src/http.cpp index 40aca3c030b2923495f6cb0c48422e5bb26b1030..d7e33bb001061e6af049f0a01194be19ac11b5e5 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -87,7 +87,7 @@ Url::Url(const std::string& url): url(url) std::string Url::toString() const { - std::stringstream ss; + std::ostringstream ss; if (not protocol.empty()) { ss << protocol << "://"; } @@ -1044,7 +1044,7 @@ Request::set_auth(const std::string& username, const std::string& password) void Request::build() { - std::stringstream request; + std::ostringstream request; bool append_body = !body_.empty(); // first header diff --git a/src/indexation/pht.cpp b/src/indexation/pht.cpp index 0840c0e3fb4d7043608b9bc000eac241ee3ec45a..3aba81d4eff52462c6db588e515ce14fcfa9aa51 100644 --- a/src/indexation/pht.cpp +++ b/src/indexation/pht.cpp @@ -32,7 +32,7 @@ namespace indexation { * @return string that represent the blob into a readable way */ static std::string blobToString(const Blob &bl) { - std::stringstream ss; + std::ostringstream ss; auto bn = bl.size() % 8; auto n = bl.size() / 8; @@ -46,7 +46,7 @@ static std::string blobToString(const Blob &bl) { } std::string Prefix::toString() const { - std::stringstream ss; + std::ostringstream ss; ss << "Prefix : " << std::endl << "\tContent_ : \""; ss << blobToString(content_); diff --git a/src/node.cpp b/src/node.cpp index c444bbe22a7e1c2b907c2f3f264be4146b0a72b5..e2334ee58226bbd1ada5342bc8503e11945752b4 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -160,7 +160,7 @@ Node::closeSocket(Tid id) std::string Node::toString() const { - std::stringstream ss; + std::ostringstream ss; ss << (*this); return ss.str(); }