diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-08-24 12:27:51 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-08-24 12:27:51 +0200 |
commit | b200104cf2c61465acecaca111e3ec727fc3b954 (patch) | |
tree | 818f420f734ad68a6c819b18b34fc93db38d7643 /src/usermanager.cpp | |
parent | fb7acf3bf7db27f61d9261a99862654dd3721a06 (diff) |
Check for errors after calling IOHookProvider::OnAccept()
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r-- | src/usermanager.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 15c86157b..b3ee21f2b 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -91,8 +91,16 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i) { ListenSocket::IOHookProvRef& iohookprovref = *i; - if (iohookprovref) - iohookprovref->OnAccept(eh, client, server); + if (!iohookprovref) + continue; + + iohookprovref->OnAccept(eh, client, server); + // IOHook could have encountered a fatal error, e.g. if the TLS ClientHello was already in the queue and there was no common TLS version + if (!eh->getError().empty()) + { + QuitUser(New, eh->getError()); + return; + } } if (this->local_users.size() > ServerInstance->Config->SoftLimit) |