summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/treesocket1.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 20:50:07 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 20:50:07 +0000
commit66d187fa55b4fdcb38ec987c269c4c1573a441b5 (patch)
tree6560fe4224b89abf745ef8a90d913ef85b582441 /src/modules/m_spanningtree/treesocket1.cpp
parent8c3a4a51ff092a0614e6c9a15e4bd53e4877bc48 (diff)
Store id in TreeServer, use TreeServer::GetID() to get the id (NOTE: it is std::string)
Server id sent on all outbound and inbound SERVER now. last parameter before desc. Min params for SERVER is now 5, not 4. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7918 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/treesocket1.cpp')
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index f419f9bec..9c53a16cd 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -268,7 +268,9 @@ void TreeSocket::SendServers(TreeServer* Current, TreeServer* s, int hops)
TreeServer* recursive_server = Current->GetChild(q);
if (recursive_server != s)
{
- snprintf(command,1024,":%s SERVER %s * %d :%s",Current->GetName().c_str(),recursive_server->GetName().c_str(),hops,recursive_server->GetDesc().c_str());
+ snprintf(command,1024,":%s SERVER %s * %d %s :%s",Current->GetName().c_str(),recursive_server->GetName().c_str(),hops,
+ recursive_server->GetID().c_str(),
+ recursive_server->GetDesc().c_str());
this->WriteLine(command);
this->WriteLine(":"+recursive_server->GetName()+" VERSION :"+recursive_server->GetVersion());
/* down to next level */
@@ -432,6 +434,12 @@ bool TreeSocket::Capab(const std::deque<std::string> &params)
}
else if (params[0] == "END")
{
+ std::string OurSID;
+
+ OurSID += (char)((Instance->Config->sid / 100) + 48);
+ OurSID += (char)((Instance->Config->sid / 10) % 10 + 48);
+ OurSID += (char)(Instance->Config->sid % 10 + 48);
+
std::string reason;
int ip6support = 0;
#ifdef SUPPORT_IP6LINKS
@@ -503,14 +511,15 @@ bool TreeSocket::Capab(const std::deque<std::string> &params)
this->SetTheirChallenge(n->second);
if (!this->GetTheirChallenge().empty() && (this->LinkState == CONNECTING))
{
- this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(OutboundPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
+ this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(OutboundPass, this->GetTheirChallenge())+" 0 "+
+ OurSID+" :"+this->Instance->Config->ServerDesc);
}
}
else
{
/* They didnt specify a challenge or we don't have m_sha256.so, we use plaintext */
if (this->LinkState == CONNECTING)
- this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+OutboundPass+" 0 :"+this->Instance->Config->ServerDesc);
+ this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+OutboundPass+" 0 "+OurSID+" :"+this->Instance->Config->ServerDesc);
}
if (reason.length())