X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree.cpp;h=1dbf54b59e2eeaebec146e8b67b0419f805b206f;hb=2ea814385ef00a34f150e08c3dae14ef90978458;hp=060c4c39bc01f7ac738171a15c1c5c2caec6e441;hpb=20dbeb8cef60920c140ff08fa3e0d9f2c01fa430;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 060c4c39b..1dbf54b59 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1533,11 +1533,35 @@ class TreeSocket : public InspSocket { if (params.size() < 1) return true; - TreeServer* ServerSource = FindServer(prefix); - if (ServerSource) + if (params.size() == 1) { - ServerSource->SetPingFlag(); + TreeServer* ServerSource = FindServer(prefix); + if (ServerSource) + { + ServerSource->SetPingFlag(); + } } + else + { + std::string forwardto = params[1]; + if (forwardto == Srv->GetServerName()) + { + // this is a PONG for us + // if the prefix is a user, check theyre local, and if they are, + // dump the PONG reply back to their fd. If its a server, do nowt. + // Services might want to send these s->s, but we dont need to yet. + userrec* u = Srv->FindNick(prefix); + if (u) + { + WriteServ(u->fd,"PONG %s %s",params[0].c_str(),params[1].c_str()); + } + } + else + { + // not for us, pass it on :) + DoOneToOne(prefix,"PONG",params,forwardto); + } + } return true; } @@ -1641,6 +1665,10 @@ class TreeSocket : public InspSocket params[5] = ":" + params[5]; DoOneToAllButSender(prefix,"ADDLINE",params,prefix); } + if (!this->bursting) + { + apply_lines(APPLY_ZLINES|APPLY_GLINES|APPLY_QLINES); + } return true; } @@ -1797,9 +1825,29 @@ class TreeSocket : public InspSocket { if (params.size() < 1) return true; - std::string stufftobounce = params[0]; - this->WriteLine(":"+Srv->GetServerName()+" PONG "+stufftobounce); - return true; + if (params.size() == 1) + { + std::string stufftobounce = params[0]; + this->WriteLine(":"+Srv->GetServerName()+" PONG "+stufftobounce); + return true; + } + else + { + std::string forwardto = params[1]; + if (forwardto == Srv->GetServerName()) + { + // this is a ping for us, send back PONG to the requesting server + params[1] = params[0]; + params[0] = forwardto; + DoOneToOne(forwardto,"PONG",params,params[1]); + } + else + { + // not for us, pass it on :) + DoOneToOne(prefix,"PING",params,forwardto); + } + return true; + } } bool RemoteServer(std::string prefix, std::deque ¶ms) @@ -2269,6 +2317,7 @@ class TreeSocket : public InspSocket else if (command == "ENDBURST") { this->bursting = false; + apply_lines(APPLY_ZLINES|APPLY_GLINES|APPLY_QLINES); return true; } else