aboutsummaryrefslogtreecommitdiffstats
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorGravatar om2006-04-07 23:16:45 +0000
committerGravatar om2006-04-07 23:16:45 +0000
commit39d2c7c6dfdc88097e5e06d63f7d906e28054469 (patch)
tree18b97cf3de181db85991baaf2e7236cd4558b497 /src/helperfuncs.cpp
parentSlight optimisation to config reader, looks nicer even if it's not faster. (diff)
downloadinspircd++-39d2c7c6dfdc88097e5e06d63f7d906e28054469.tar.gz
inspircd++-39d2c7c6dfdc88097e5e06d63f7d906e28054469.tar.bz2
inspircd++-39d2c7c6dfdc88097e5e06d63f7d906e28054469.zip
Make WriteServ use WriteServ_NoFormat, code duplication = bad >:/
Change some weirdness using a stringstream for a simple append. Force a flush of all opers' write buffers after they get the oper notice about a /DIE git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3842 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 46a85da2c..c467172d8 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -293,31 +293,8 @@ void WriteServ(int sock, char* text, ...)
va_start(argsPtr, text);
vsnprintf(textbuffer, MAXBUF, text, argsPtr);
va_end(argsPtr);
- bytes = snprintf(tb,MAXBUF,":%s %s\r\n",Config->ServerName,textbuffer);
- chop(tb);
-
- if (fd_ref_table[sock])
- {
- if (Config->GetIOHook(fd_ref_table[sock]->port))
- {
- try
- {
- Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
- }
- catch (ModuleException& modexcept)
- {
- log(DEBUG,"Module exception caught: %s",modexcept.GetReason());
- }
- }
- else
- {
- fd_ref_table[sock]->AddWriteBuf(tb);
- }
-
- ServerInstance->stats->statsSent += bytes;
- }
- else
- log(DEFAULT,"ERROR! attempted write to a user with no fd_ref_table entry!!!");
+
+ WriteServ_NoFormat(sock, textbuffer);
}
/** WriteFrom_NoFormat()