extern user_hash clientlist;
extern chan_hash chanlist;
extern command_table cmdlist;
+extern Module* IOHookModule;
static char textbuffer[MAXBUF];
static char tb[MAXBUF];
chop(tb);
if (fd_ref_table[sock])
{
- int MOD_RESULT = 0;
- FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes));
- fd_ref_table[sock]->AddWriteBuf(tb);
- stats->statsSent += bytes;
+ if (IOHookModule)
+ {
+ IOHookModule->OnRawSocketWrite(sock,tb,bytes);
+ }
+ else
+ {
+ fd_ref_table[sock]->AddWriteBuf(tb);
+ }
+ stats->statsSent += bytes;
}
else log(DEFAULT,"ERROR! attempted write to a user with no fd_ref_table entry!!!");
}
chop(tb);
if (fd_ref_table[sock])
{
- int MOD_RESULT = 0;
- FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes));
- fd_ref_table[sock]->AddWriteBuf(tb);
+ if (IOHookModule)
+ {
+ IOHookModule->OnRawSocketWrite(sock,tb,bytes);
+ }
+ else
+ {
+ fd_ref_table[sock]->AddWriteBuf(tb);
+ }
stats->statsSent += bytes;
}
else log(DEFAULT,"ERROR! attempted write to a user with no fd_ref_table entry!!!");
chop(tb);
if (fd_ref_table[sock])
{
- int MOD_RESULT = 0;
- FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes));
- fd_ref_table[sock]->AddWriteBuf(tb);
+ if (IOHookModule)
+ {
+ IOHookModule->OnRawSocketWrite(sock,tb,bytes);
+ }
+ else
+ {
+ fd_ref_table[sock]->AddWriteBuf(tb);
+ }
stats->statsSent += bytes;
}
else log(DEFAULT,"ERROR! attempted write to a user with no fd_ref_table entry!!!");
snprintf(mbuf,MAXBUF,":%s 376 %s :End of message of the day.\r\n", Config->ServerName, user->nick);
WholeMOTD = WholeMOTD + mbuf;
// only one write operation
- user->AddWriteBuf(WholeMOTD);
+ if (IOHookModule)
+ {
+ IOHookModule->OnRawSocketWrite(user->fd,(char*)WholeMOTD.c_str(),WholeMOTD.length());
+ }
+ else
+ {
+ user->AddWriteBuf(WholeMOTD);
+ }
stats->statsSent += WholeMOTD.length();
}