Merge pull request #313 from savoirfairelinux/proxy_server

Proxy server
This commit is contained in:
Sébastien Blin authored and GitHub committed 2018-06-28 09:16:13 -04:00
commit 1ff2eeb220
2 files changed
+7 -6

No files matched your search

+6 -5
View File
@@ -1585,11 +1585,6 @@ Dht::getStorageLog() const
std::stringstream out;
for (const auto& s : store)
out << printStorageLog(s);
out << "Total " << store.size() << " storages, " << total_values << " values (";
if (total_store_size < 1024)
out << total_store_size << " bytes)";
else
out << (total_store_size/1024) << " KB)";
out << std::endl << std::endl;
std::multimap<size_t, const SockAddr*> q_map;
for (const auto& ip : store_quota)
@@ -1598,6 +1593,12 @@ Dht::getStorageLog() const
for (auto ip = q_map.rbegin(); ip != q_map.rend(); ++ip)
out << "IP " << ip->second->toString() << " uses " << ip->first << " bytes" << std::endl;
out << std::endl;
out << "Total " << store.size() << " storages, " << total_values << " values (";
if (total_store_size < 1024)
out << total_store_size << " bytes)";
else
out << (total_store_size/1024) << " / " << (max_store_size/1024) << " KB)";
out << std::endl;
return out.str();
}
+1 -1
View File
@@ -526,7 +526,7 @@ DhtRunner::startNetwork(const SockAddr sin4, const SockAddr sin6)
std::lock_guard<std::mutex> lck(sock_mtx);
if (rcv.size() >= RX_QUEUE_MAX_SIZE) {
std::cerr << "Dropping packet: queue is full!" << std::endl;
continue;
rcv.pop();
}
rcv.emplace(ReceivedPacket {Blob {buf.begin(), buf.begin()+rc+1}, SockAddr(from, from_len), clock::now()});
}