X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fnetburst.cpp;h=11e44ab86faba12d0b3ff833ddf78bb16d0c0855;hb=83137d5f9274832f152acc7d19de3cb0897f9630;hp=9e9d3a3b8102e25f5c0d7a9da5629d59ef731973;hpb=60f3d89d5907049a2627d134b652c675b052602b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 9e9d3a3b8..11e44ab86 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -29,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); @@ -151,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(); @@ -165,18 +164,21 @@ void TreeSocket::SendXLines(TreeServer* Current) { for (LookupIter i = lookup->begin(); i != lookup->end(); ++i) { - snprintf(data,MAXBUF,":%s ADDLINE %s %s %s %lu %lu :%s\r\n",sn, it->c_str(), i->second->Displayable(), + /* 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",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 */ @@ -186,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);