summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp12
-rw-r--r--src/modules/m_spanningtree/uid.cpp14
2 files changed, 20 insertions, 6 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 7e5c7fad5..e27c1d879 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -534,13 +534,17 @@ bool TreeSocket::ProcessLine(std::string &line)
* Not a special s2s command. Emulate the user doing it.
* This saves us having a huge ugly command parser again.
*/
- User *who = this->ServerInstance->FindUUID(prefix);
+ User* who = this->ServerInstance->FindUUID(prefix);
if (!who)
{
- // this looks ugly because command is an irc::string
- this->SendError("Command (" + std::string(command.c_str()) + ") from unknown prefix (" + prefix + ")! Dropping link.");
- return false;
+ /* this looks ugly because command is an irc::string
+ * It is important that we dont close the link here, unknown prefix can occur
+ * due to various race conditions such as the KILL message for a user somehow
+ * crossing the users QUIT further upstream from the server. Thanks jilles!
+ */
+ ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Command " + std::string(command.c_str()) + " from unknown prefix " + prefix + "! Dropping entire command.");
+ return true;
}
if (command == "NICK")
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index 3cc4c9618..682b4d29a 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -120,7 +120,12 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
if (paramptr < params.size() - 1)
mh->OnModeChange(_new, _new, NULL, params[paramptr++], true);
else
- ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Warning: Broken UID command, expected a parameter for user mode '%c' but there aren't enough parameters in the command!", *v);
+ {
+ this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Broken UID command, expected a parameter for user mode '"+(*v)+"' but there aren't enough parameters in the command!");
+ this->ServerInstance->Users->clientlist->erase(params[0]);
+ delete _new;
+ return true;
+ }
}
else
mh->OnModeChange(_new, _new, NULL, empty, true);
@@ -128,7 +133,12 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
mh->ChangeCount(1);
}
else
- ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Warning: Broken UID command, unknown user mode '%c' in the mode string!", *v);
+ {
+ this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Warning: Broken UID command, unknown user mode '"+(*v)+"' in the mode string!");
+ this->ServerInstance->Users->clientlist->erase(params[0]);
+ delete _new;
+ return true;
+ }
}
//_new->ProcessNoticeMasks(params[7].c_str());