mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 12:28:42 +00:00
remove headers, fix HTTP status, fix get /
This commit is contained in:
1 parent
38ad5b9ef2
commit
bbe922dd7d
4 files changed
+120
-85
No files matched your search
@@ -68,4 +68,24 @@ NodeStats::toString() const
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
#if OPENDHT_PROXY_SERVER
|
||||
/**
|
||||
* Build a json object from a NodeStats
|
||||
*/
|
||||
Json::Value
|
||||
NodeStats::toJson() const
|
||||
{
|
||||
Json::Value val;
|
||||
val["good"] = static_cast<Json::LargestUInt>(good_nodes);
|
||||
val["dubious"] = static_cast<Json::LargestUInt>(dubious_nodes);
|
||||
val["incoming"] = static_cast<Json::LargestUInt>(incoming_nodes);
|
||||
if (table_depth > 1) {
|
||||
val["table_depth"] = static_cast<Json::LargestUInt>(table_depth);
|
||||
unsigned long tot_nodes = 8 * std::exp2(table_depth);
|
||||
val["network_size_estimation"] = static_cast<Json::LargestUInt>(tot_nodes);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
#endif //OPENDHT_PROXY_SERVER
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user