diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-16 01:14:02 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-16 01:14:02 +0000 |
commit | 0b6295a0aa384ba11522abf7b417593fb28c407c (patch) | |
tree | 2e88e54618710d8f55d87ec1185364445b197337 /src/userprocess.cpp | |
parent | 0b675b72d5ca8a963734ca838e8ae81230046a66 (diff) |
Changed I/O reading stuff for modules to be much faster (and exclusive :()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2500 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/userprocess.cpp')
-rw-r--r-- | src/userprocess.cpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/userprocess.cpp b/src/userprocess.cpp index b5a5b6683..f8d7218cf 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -79,22 +79,31 @@ char data[65536]; extern user_hash clientlist; extern chan_hash chanlist; +extern Module* IOHookModule; + void ProcessUser(userrec* cu) { int result = EAGAIN; log(DEBUG,"Processing user with fd %d",cu->fd); - int MOD_RESULT = 0; - int result2 = 0; - FOREACH_RESULT(OnRawSocketRead(cu->fd,data,65535,result2)); - if (!MOD_RESULT) - { - result = cu->ReadData(data, 65535); - } - else - { - log(DEBUG,"Data result returned by module: %d",MOD_RESULT); - result = result2; - } + if (IOHookModule) + { + int MOD_RESULT = 0; + int result2 = 0; + IOHookModule->OnRawSocketRead(cu->fd,data,65535,result2); + if (!MOD_RESULT) + { + result = cu->ReadData(data, 65535); + } + else + { + log(DEBUG,"Data result returned by module: %d",MOD_RESULT); + result = result2; + } + } + else + { + result = cu->ReadData(data, 65535); + } log(DEBUG,"Read result: %d",result); if (result) { |