X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_spanningtree%2Fnetburst.cpp;h=c2e365c35129ece0b707aae08198d40452908d0f;hb=da074814501f23680b579feb1ad649c86e8a1348;hp=002845af3bff534abc5756994df6c0b23dc2e4ee;hpb=488ea09da27c89bb486e9de25d506b357631e3df;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 002845af3..c2e365c35 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -12,24 +12,14 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" -#include "socket.h" -#include "wildcard.h" #include "xline.h" -#include "transport.h" -#include "m_hash.h" -#include "socketengine.h" -#include "m_spanningtree/main.h" -#include "m_spanningtree/utils.h" -#include "m_spanningtree/treeserver.h" -#include "m_spanningtree/link.h" #include "m_spanningtree/treesocket.h" -#include "m_spanningtree/resolvers.h" -#include "m_spanningtree/handshaketimer.h" +#include "m_spanningtree/treeserver.h" +#include "m_spanningtree/utils.h" + +/* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_hash.h */ /** This function is called when we want to send a netburst to a local * server. There is a set order we must do this, because for example @@ -39,7 +29,7 @@ void TreeSocket::DoBurst(TreeServer* s) { std::string name = s->GetName(); - std::string burst = ":" + this->Instance->Config->GetSID() + " BURST " +ConvToStr(Instance->Time(true)); + std::string burst = ":" + this->Instance->Config->GetSID() + " BURST " +ConvToStr(Instance->Time()); std::string endburst = ":" + this->Instance->Config->GetSID() + " ENDBURST"; this->Instance->SNO->WriteToSnoMask('l',"Bursting to \2%s\2 (Authentication: %s).", name.c_str(), this->GetTheirChallenge().empty() ? "plaintext password" : "SHA256-HMAC challenge-response"); this->WriteLine(burst); @@ -161,7 +151,6 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c) void TreeSocket::SendXLines(TreeServer* Current) { char data[MAXBUF]; - std::string buffer; std::string n = this->Instance->Config->GetSID(); const char* sn = n.c_str(); @@ -175,18 +164,21 @@ void TreeSocket::SendXLines(TreeServer* Current) { for (LookupIter i = lookup->begin(); i != lookup->end(); ++i) { + /* Is it burstable? this is better than an explicit check for type 'K'. + * We break the loop as NONE of the items in this group are worth iterating. + */ + if (!i->second->IsBurstable()) + break; + snprintf(data,MAXBUF,":%s ADDLINE %s %s %s %lu %lu :%s\r\n",sn, it->c_str(), i->second->Displayable(), i->second->source, (unsigned long)i->second->set_time, (unsigned long)i->second->duration, i->second->reason); - buffer.append(data); + this->WriteLine(data); } } } - - if (!buffer.empty()) - this->WriteLine(buffer); } /** Send channel modes and topics */ @@ -196,7 +188,7 @@ void TreeSocket::SendChannelModes(TreeServer* Current) std::deque list; std::string n = this->Instance->Config->GetSID(); const char* sn = n.c_str(); - Instance->Log(DEBUG,"Sending channels and modes, %d to send", this->Instance->chanlist->size()); + Instance->Logs->Log("m_spanningtree",DEBUG,"Sending channels and modes, %d to send", this->Instance->chanlist->size()); for (chan_hash::iterator c = this->Instance->chanlist->begin(); c != this->Instance->chanlist->end(); c++) { SendFJoins(Current, c->second);