diff options
| author | 2020-07-29 12:13:45 +0100 | |
|---|---|---|
| committer | 2020-07-29 12:13:45 +0100 | |
| commit | e059f822495b02f73f85a668c152c8233cb66f92 (patch) | |
| tree | 3fc144657d6843f6b07caec69839921bdc962663 /include | |
| parent | Add a method for creating a regex pattern with included flags. (diff) | |
| parent | Replace all erroneous space indentation with tab indentation. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'include')
| -rw-r--r-- | include/inspsocket.h | 5 | ||||
| -rw-r--r-- | include/modules/ssl.h | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/inspsocket.h b/include/inspsocket.h index 23b7a3206..1b981b0e2 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -359,6 +359,11 @@ class CoreExport StreamSocket : public EventHandler * @return IOHook belonging to the module or NULL if the module haven't attached an IOHook to this socket */ IOHook* GetModHook(Module* mod) const; + + /** Get the last IOHook attached to this socket + * @return The last IOHook attached to this socket or NULL if no IOHooks are attached + */ + IOHook* GetLastHook() const; }; /** * BufferedSocket is an extendable socket class which modules diff --git a/include/modules/ssl.h b/include/modules/ssl.h index bbee38867..b72a518cb 100644 --- a/include/modules/ssl.h +++ b/include/modules/ssl.h @@ -187,9 +187,10 @@ class SSLIOHook : public IOHook public: static SSLIOHook* IsSSL(StreamSocket* sock) { - IOHook* const iohook = sock->GetIOHook(); - if ((iohook) && ((iohook->prov->type == IOHookProvider::IOH_SSL))) - return static_cast<SSLIOHook*>(iohook); + IOHook* const lasthook = sock->GetLastHook(); + if (lasthook && (lasthook->prov->type == IOHookProvider::IOH_SSL)) + return static_cast<SSLIOHook*>(lasthook); + return NULL; } |
