diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-07-27 19:11:48 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-07-27 19:11:48 +0200 |
commit | 3c810a7af5f568ae870c4439b5ea2a4d89fa7d01 (patch) | |
tree | 72ca28b36b4c8be903fa713b7dbe751e8d0e73cb /src/modules/m_spanningtree/treeserver.h | |
parent | ba86605dd081407c00a45559f288ba6a4046c3cd (diff) |
m_spanningtree Keep track of whether servers are behind a bursting server, use it to implement quietbursts
Diffstat (limited to 'src/modules/m_spanningtree/treeserver.h')
-rw-r--r-- | src/modules/m_spanningtree/treeserver.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h index 192896cdb..3f1f0755d 100644 --- a/src/modules/m_spanningtree/treeserver.h +++ b/src/modules/m_spanningtree/treeserver.h @@ -53,6 +53,13 @@ class TreeServer : public Server bool LastPingWasGood; /* True if the server responded to the last PING with a PONG */ std::string sid; /* Server ID */ + /** Counter counting how many servers are bursting in front of this server, including + * this server. Set to parents' value on construction then it is increased if the + * server itself starts bursting. Decreased when a server on the path to this server + * finishes burst. + */ + unsigned int behind_bursting; + /** This method is used to add this TreeServer to the * hash maps. It is only called by the constructors. */ @@ -199,6 +206,12 @@ class TreeServer : public Server */ bool IsBursting() const { return (StartBurst != 0); } + /** Check whether this server is behind a bursting server or is itself bursting. + * This can tell whether a user is on a part of the network that is still bursting. + * @return True if this server is bursting or is behind a server that is bursting, false if it isn't + */ + bool IsBehindBursting() const { return (behind_bursting != 0); } + /** Set the bursting state of the server * @param startms Time the server started bursting, if 0 or omitted, use current time */ |