summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-21 13:26:31 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-21 13:26:31 +0000
commite2af2347fc035d702e45f12e772223a8d578410d (patch)
treebfd80aac2858a9f4faedc316794fc1051dbaa72c /src/helperfuncs.cpp
parent16fc672b685752007e47aed0fb97bc1ee7443c76 (diff)
Create StreamSocket for IO hooking implementation
Fixes the SSL SendQ bug Removes duplicate code between User and BufferedSocket Simplify SSL module API Simplify EventHandler API (Readable/Writeable moved to SE) Add hook for culled objects to invoke callbacks prior to destructor Replace SocketCull with GlobalCull now that sockets can close themselves Shorten common case of user read/parse/write path: User::Write is now zero-copy up to syscall/SSL invocation User::Read has only two copy/scan passes from read() to ProcessCommand git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 0ec8db966..80feae464 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -125,20 +125,16 @@ void InspIRCd::SendError(const std::string &s)
{
for (std::vector<User*>::const_iterator i = this->Users->local_users.begin(); i != this->Users->local_users.end(); i++)
{
- if ((*i)->registered == REG_ALL)
+ User* u = *i;
+ if (u->registered == REG_ALL)
{
- (*i)->WriteServ("NOTICE %s :%s",(*i)->nick.c_str(),s.c_str());
+ u->WriteServ("NOTICE %s :%s",u->nick.c_str(),s.c_str());
}
else
{
/* Unregistered connections receive ERROR, not a NOTICE */
- (*i)->Write("ERROR :" + s);
+ u->Write("ERROR :" + s);
}
- /* This might generate a whole load of EAGAIN, but we dont really
- * care about this, as if we call SendError something catastrophic
- * has occured anyway, and we wont receive the events for these.
- */
- (*i)->FlushWriteBuf();
}
}