mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
add lease set page in http server
This commit is contained in:
parent
4fdd9feddc
commit
71cc4b5bf2
4 changed files with 76 additions and 3 deletions
11
NetDb.h
11
NetDb.h
|
@ -32,7 +32,10 @@ namespace data
|
|||
const int NETDB_MIN_EXPIRATION_TIMEOUT = 90*60; // 1.5 hours
|
||||
const int NETDB_MAX_EXPIRATION_TIMEOUT = 27*60*60; // 27 hours
|
||||
const int NETDB_PUBLISH_INTERVAL = 60*40;
|
||||
|
||||
|
||||
/** function for visiting a leaseset stored in a floodfill */
|
||||
typedef std::function<void(const IdentHash, std::shared_ptr<LeaseSet>)> LeaseSetVisitor;
|
||||
|
||||
class NetDb
|
||||
{
|
||||
public:
|
||||
|
@ -80,7 +83,10 @@ namespace data
|
|||
int GetNumRouters () const { return m_RouterInfos.size (); };
|
||||
int GetNumFloodfills () const { return m_Floodfills.size (); };
|
||||
int GetNumLeaseSets () const { return m_LeaseSets.size (); };
|
||||
|
||||
|
||||
/** visit all lease sets we currently store */
|
||||
void VisitLeaseSets(LeaseSetVisitor v);
|
||||
|
||||
private:
|
||||
|
||||
void Load ();
|
||||
|
@ -98,6 +104,7 @@ namespace data
|
|||
|
||||
private:
|
||||
|
||||
mutable std::mutex m_LeaseSetsMutex;
|
||||
std::map<IdentHash, std::shared_ptr<LeaseSet> > m_LeaseSets;
|
||||
mutable std::mutex m_RouterInfosMutex;
|
||||
std::map<IdentHash, std::shared_ptr<RouterInfo> > m_RouterInfos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue