diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-08-08 14:31:49 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-08-08 14:31:49 +0200 |
commit | eef55acb1dbb2ae6c0202fec54e12506c064f892 (patch) | |
tree | d7e4e3e313053294192715d9f7bca1b426b8d232 /src/inspsocket.cpp | |
parent | 3a11a742ba35155e1b2e14dc4ef1a4f7f659ea13 (diff) |
Add StreamSocket::GetModHook() for obtaining the IOHook belonging to a given module
Use it to simplify logic in all modules using or providing IOHooks
Diffstat (limited to 'src/inspsocket.cpp')
-rw-r--r-- | src/inspsocket.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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; +} |