From d256e357ee65a8535738fa4a370da4086023043a Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 17 Jun 2014 13:20:57 +0200 Subject: m_spanningtree Add TreeSocket::SendServerInfo() that sends all additional data about a server --- src/modules/m_spanningtree/netburst.cpp | 11 ++++++++--- src/modules/m_spanningtree/treesocket.h | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 2703ad0f0..595d04590 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -108,8 +108,6 @@ void TreeSocket::DoBurst(TreeServer* s) capab->auth_challenge ? "challenge-response" : "plaintext password"); this->CleanNegotiationInfo(); this->WriteLine(":" + ServerInstance->Config->GetSID() + " BURST " + ConvToStr(ServerInstance->Time())); - /* send our version string */ - this->WriteLine(":" + ServerInstance->Config->GetSID() + " VERSION :"+ServerInstance->GetVersionString()); /* Send server tree */ this->SendServers(Utils->TreeRoot, s); @@ -127,6 +125,12 @@ void TreeSocket::DoBurst(TreeServer* s) ServerInstance->SNO->WriteToSnoMask('l',"Finished bursting to \2"+ s->GetName()+"\2."); } +void TreeSocket::SendServerInfo(TreeServer* from) +{ + // Send public version string + this->WriteLine(CmdBuilder(from->GetID(), "VERSION").push_last(from->GetVersion())); +} + /** Recursively send the server tree. * This is used during network burst to inform the other server * (and any of ITS servers too) of what servers we know about. @@ -136,6 +140,8 @@ void TreeSocket::DoBurst(TreeServer* s) */ void TreeSocket::SendServers(TreeServer* Current, TreeServer* s) { + SendServerInfo(Current); + const TreeServer::ChildServers& children = Current->GetChildren(); for (TreeServer::ChildServers::const_iterator i = children.begin(); i != children.end(); ++i) { @@ -143,7 +149,6 @@ void TreeSocket::SendServers(TreeServer* Current, TreeServer* s) if (recursive_server != s) { this->WriteLine(CommandServer::Builder(recursive_server)); - this->WriteLine(":" + recursive_server->GetID() + " VERSION :" + recursive_server->GetVersion()); /* down to next level */ this->SendServers(recursive_server, s); } diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 4f72ed006..a06ea0019 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -114,6 +114,9 @@ class TreeSocket : public BufferedSocket /** Send all users and their oper state, away state and metadata */ void SendUsers(BurstState& bs); + /** Send all additional info about the given server to this server */ + void SendServerInfo(TreeServer* from); + public: const time_t age; -- cgit v1.2.3