X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fserver.cpp;h=bc97c097b2d8c2ae9b3a0f780c5d4cd14816196f;hb=da28fe0b8c0bec9ab111044b1004f24cbf2d742e;hp=1b13fb2da60b243e23e37d37da8337b187d73436;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index 1b13fb2da..bc97c097b 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -55,7 +55,7 @@ bool TreeSocket::RemoteServer(const std::string &prefix, parameterlist ¶ms) this->SendError("Protocol error - Introduced remote server from unknown server "+prefix); return false; } - if (!ServerInstance->IsSID(sid)) + if (!InspIRCd::IsSID(sid)) { this->SendError("Invalid format server ID: "+sid+"!"); return false; @@ -105,7 +105,7 @@ bool TreeSocket::Outbound_Reply_Server(parameterlist ¶ms) std::string password = params[1]; std::string sid = params[3]; std::string description = params[4]; - int hops = atoi(params[2].c_str()); + int hops = ConvToInt(params[2]); this->SendCapabilities(2); @@ -163,15 +163,15 @@ bool TreeSocket::Outbound_Reply_Server(parameterlist ¶ms) linkID = sname; MyRoot = new TreeServer(Utils, sname, description, sid, Utils->TreeRoot, this, x->Hidden); - Utils->TreeRoot->AddChild(MyRoot); + this->DoBurst(MyRoot); + params[4] = ":" + params[4]; /* IMPORTANT: Take password/hmac hash OUT of here before we broadcast the introduction! */ params[1] = "*"; Utils->DoOneToAllButSender(ServerInstance->Config->GetSID(),"SERVER",params,sname); - this->DoBurst(MyRoot); return true; } @@ -197,7 +197,7 @@ bool TreeSocket::Inbound_Server(parameterlist ¶ms) std::string password = params[1]; std::string sid = params[3]; std::string description = params[4]; - int hops = atoi(params[2].c_str()); + int hops = ConvToInt(params[2]); this->SendCapabilities(2); @@ -237,7 +237,7 @@ bool TreeSocket::Inbound_Server(parameterlist ¶ms) } /* Check for fully initialized instances of the server by id */ - ServerInstance->Logs->Log("m_spanningtree",DEBUG,"Looking for dupe SID %s", sid.c_str()); + ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG,"Looking for dupe SID %s", sid.c_str()); CheckDupe = Utils->FindServerID(sid); if (CheckDupe) @@ -254,15 +254,11 @@ bool TreeSocket::Inbound_Server(parameterlist ¶ms) // this is good. Send our details: Our server name and description and hopcount of 0, // along with the sendpass from this block. this->SendCapabilities(2); - this->WriteLine(std::string("SERVER ")+ServerInstance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); + this->WriteLine("SERVER "+ServerInstance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+ServerInstance->Config->GetSID()+" :"+ServerInstance->Config->ServerDesc); // move to the next state, we are now waiting for THEM. MyRoot = new TreeServer(Utils, sname, description, sid, Utils->TreeRoot, this, x->Hidden); Utils->TreeRoot->AddChild(MyRoot); - params[1] = "*"; - params[4] = ":" + params[4]; - Utils->DoOneToAllButSender(ServerInstance->Config->GetSID(),"SERVER",params,sname); - this->LinkState = WAIT_AUTH_2; return true; }