From b111d5098fe1ee306d2718c82c72f969db9d183d Mon Sep 17 00:00:00 2001 From: Guillaume Delacour Date: Sun, 28 Feb 2016 10:47:34 +0100 Subject: Minor spelling errors in m_spanningtree.so --- src/modules/m_spanningtree/fjoin.cpp | 2 +- src/modules/m_spanningtree/postcommand.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 47b394522..4ec6e1dbb 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -201,7 +201,7 @@ CmdResult CommandFJoin::Handle(const std::vector& params, User *src } else { - ServerInstance->Logs->Log("m_spanningtree",SPARSE, "Ignored nonexistant user %s in fjoin to %s (probably quit?)", usr, channel.c_str()); + ServerInstance->Logs->Log("m_spanningtree",SPARSE, "Ignored nonexistent user %s in fjoin to %s (probably quit?)", usr, channel.c_str()); continue; } } diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index 471bbfcb9..3f5d427e1 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -73,7 +73,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, const std::string & TreeServer* sdest = FindServer(routing.serverdest); if (!sdest) { - ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Trying to route ENCAP to nonexistant server %s", + ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Trying to route ENCAP to nonexistent server %s", routing.serverdest.c_str()); return; } -- cgit v1.2.3 From 5f29158a5b7a892bde7dff26d87f94aacc8beadb Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 29 Jul 2016 13:09:43 -0400 Subject: Fix bursting channel bans --- src/modules/m_spanningtree/netburst.cpp | 25 ++++++++++++++----------- src/modules/m_spanningtree/treesocket.h | 2 ++ 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index d508c092d..3bce90eda 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -140,25 +140,28 @@ void TreeSocket::SendFJoins(Channel* c) buffer.append(list).append("\r\n"); } - int linesize = 1; + unsigned int linesize = 1; for (BanList::iterator b = c->bans.begin(); b != c->bans.end(); b++) { - int size = b->data.length() + 2; - int currsize = linesize + size; - if (currsize <= 350) - { - modes.append("b"); - params.append(" ").append(b->data); - linesize += size; - } - if ((modes.length() >= ServerInstance->Config->Limits.MaxModes) || (currsize > 350)) + unsigned int size = b->data.length() + 2; // "b" and " " + unsigned int nextsize = linesize + size; + + if ((modes.length() >= ServerInstance->Config->Limits.MaxModes) || (nextsize > FMODE_MAX_LENGTH)) { - /* Wrap at MAXMODES */ + /* Wrap */ buffer.append(":").append(ServerInstance->Config->GetSID()).append(" FMODE ").append(c->name).append(" ").append(ConvToStr(c->age)).append(" +").append(modes).append(params).append("\r\n"); + modes.clear(); params.clear(); linesize = 1; } + + modes.push_back('b'); + + params.push_back(' '); + params.append(b->data); + + linesize += size; } /* Only send these if there are any */ diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index abda28335..efcce5f7a 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -100,6 +100,8 @@ class TreeSocket : public BufferedSocket int proto_version; /* Remote protocol version */ bool ConnectionFailureShown; /* Set to true if a connection failure message was shown */ + static const unsigned int FMODE_MAX_LENGTH = 350; + /** Checks if the given servername and sid are both free */ bool CheckDuplicate(const std::string& servername, const std::string& sid); -- cgit v1.2.3 From 25cdcdc777c265124e55bf0fb94fdd856065f25b Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 5 Aug 2016 20:50:11 +0100 Subject: Fix challenge auth when using m_hash_gnutls instead of m_sha256. --- src/modules/m_spanningtree/capab.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index 7b6435898..0ab815fef 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -27,6 +27,7 @@ #include "utils.h" #include "link.h" #include "main.h" +#include "../hash.h" std::string TreeSocket::MyModules(int filter) { @@ -134,7 +135,7 @@ void TreeSocket::SendCapabilities(int phase) std::string extra; /* Do we have sha256 available? If so, we send a challenge */ - if (Utils->ChallengeResponse && (ServerInstance->Modules->Find("m_sha256.so"))) + if (Utils->ChallengeResponse && (ServerInstance->Modules->FindDataService("hash/sha256"))) { SetOurChallenge(ServerInstance->GenRandomStr(20)); extra = " CHALLENGE=" + this->GetOurChallenge(); @@ -320,7 +321,7 @@ bool TreeSocket::Capab(const parameterlist ¶ms) /* Challenge response, store their challenge for our password */ std::map::iterator n = this->capab->CapKeys.find("CHALLENGE"); - if (Utils->ChallengeResponse && (n != this->capab->CapKeys.end()) && (ServerInstance->Modules->Find("m_sha256.so"))) + if (Utils->ChallengeResponse && (n != this->capab->CapKeys.end()) && (ServerInstance->Modules->FindDataService("hash/sha256"))) { /* Challenge-response is on now */ this->SetTheirChallenge(n->second); -- cgit v1.2.3