summaryrefslogtreecommitdiff
path: root/src/inspsocket.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-08-08 14:31:49 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-08-08 14:31:49 +0200
commiteef55acb1dbb2ae6c0202fec54e12506c064f892 (patch)
treed7e4e3e313053294192715d9f7bca1b426b8d232 /src/inspsocket.cpp
parent3a11a742ba35155e1b2e14dc4ef1a4f7f659ea13 (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.cpp10
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;
+}