From eef55acb1dbb2ae6c0202fec54e12506c064f892 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 8 Aug 2016 14:31:49 +0200 Subject: Add StreamSocket::GetModHook() for obtaining the IOHook belonging to a given module Use it to simplify logic in all modules using or providing IOHooks --- src/inspsocket.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/inspsocket.cpp') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index dcc455482..0b0507f7c 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -434,3 +434,13 @@ void StreamSocket::CheckError(BufferedSocketError errcode) OnError(errcode); } } + +IOHook* StreamSocket::GetModHook(Module* mod) const +{ + if (iohook) + { + if (iohook->prov->creator == mod) + return iohook; + } + return NULL; +} -- cgit v1.3.1-10-gc9f91