X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspsocket.cpp;h=ec528571bba2f15028daafadc5362d13a8511949;hb=67de413cad88194972d55a8ff88464370890c5a9;hp=3a8a58b5fd4eba87015bb8582a22d7920fe9e81c;hpb=3e105c6311c23787ff54388c8d21c8ac1a01fd57;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 3a8a58b5f..ec528571b 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -26,6 +26,7 @@ #include "socket.h" #include "inspstring.h" #include "socketengine.h" +#include "iohook.h" #ifndef DISABLE_WRITEV #include @@ -122,18 +123,18 @@ void StreamSocket::Close() { // final chance, dump as much of the sendq as we can DoWrite(); - if (IOHook) + if (GetIOHook()) { try { - IOHook->OnStreamSocketClose(this); + GetIOHook()->OnStreamSocketClose(this); } catch (CoreException& modexcept) { ServerInstance->Logs->Log("SOCKET", LOG_DEFAULT, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason()); } - IOHook = NULL; + DelIOHook(); } ServerInstance->SE->Shutdown(this, 2); ServerInstance->SE->DelFd(this); @@ -161,12 +162,12 @@ bool StreamSocket::GetNextLine(std::string& line, char delim) void StreamSocket::DoRead() { - if (IOHook) + if (GetIOHook()) { int rv = -1; try { - rv = IOHook->OnStreamSocketRead(this, recvq); + rv = GetIOHook()->OnStreamSocketRead(this, recvq); } catch (CoreException& modexcept) { @@ -230,7 +231,7 @@ void StreamSocket::DoWrite() } #ifndef DISABLE_WRITEV - if (IOHook) + if (GetIOHook()) #endif { int rv = -1; @@ -256,9 +257,9 @@ void StreamSocket::DoWrite() } std::string& front = sendq.front(); int itemlen = front.length(); - if (IOHook) + if (GetIOHook()) { - rv = IOHook->OnStreamSocketWrite(this, front); + rv = GetIOHook()->OnStreamSocketWrite(this, front); if (rv > 0) { // consumed the entire string, and is ready for more