summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-28 13:48:28 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-28 13:48:28 +0000
commit19157777c5f977fddbcfdc8cdad78e12bf0d6bbb (patch)
treee3e860f214483978dbd01fa8526b3e1fdf4db053 /src/modules/m_spanningtree
parentde97b98a41109a517a8e677bf9b48400038f702d (diff)
Remove the last uses of localised fake clients. This removes a lot of allocations (and uses of UIDs), and cleans things up a bit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7943 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp15
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp6
2 files changed, 4 insertions, 17 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 1a7531074..872b1d72f 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -640,9 +640,8 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
}
else
{
- /* FMODE from a server, create a fake user to receive mode feedback */
- who = new userrec(this->Instance);
- who->SetFd(FD_MAGIC_NUMBER);
+ /* FMODE from a server, use a fake user to receive mode feedback */
+ who = this->Instance->FakeClient;
smode = true; /* Setting this flag tells us we should free the userrec later */
sourceserv = source; /* Set sourceserv to the actual source string */
}
@@ -714,10 +713,6 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
}
/* If the TS is greater than ours, we drop the mode and dont pass it anywhere.
*/
-
- if (smode)
- DELETE(who);
-
return true;
}
@@ -896,8 +891,6 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
{
std::deque<std::string> stackresult;
const char* mode_junk[MAXMODES+2];
- userrec* n = new userrec(Instance);
- n->SetFd(FD_MAGIC_NUMBER);
mode_junk[0] = channel.c_str();
while (modestack.GetStackedLine(stackresult))
@@ -906,10 +899,8 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
{
mode_junk[j+1] = stackresult[j].c_str();
}
- Instance->SendMode(mode_junk, stackresult.size() + 1, n);
+ Instance->SendMode(mode_junk, stackresult.size() + 1, Instance->FakeClient);
}
-
- delete n;
}
return true;
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 9a52e63f2..1c6761ea1 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -1480,11 +1480,7 @@ bool TreeSocket::ProcessLine(std::string &line)
const char* modelist[MAXPARAMETERS];
for (size_t i = 0; i < params.size(); i++)
modelist[i] = params[i].c_str();
- userrec* fake = new userrec(Instance);
- fake->SetFd(FD_MAGIC_NUMBER);
- this->Instance->SendMode(modelist, params.size(), fake);
-
- delete fake;
+ this->Instance->SendMode(modelist, params.size(), this->Instance->FakeClient);
/* Hot potato! pass it on! */
return Utils->DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params);
}