Add exception handling in handlePendingConnection

This commit is contained in:
Benau 2018-07-19 14:48:50 +08:00
parent 7ebd1fabd9
commit 4ccb405cd1

View File

@ -1857,16 +1857,25 @@ void ServerLobby::handlePendingConnection()
auto key = m_keys.find(online_id);
if (key != m_keys.end() && key->second.m_tried == false)
{
if (decryptConnectionRequest(peer, it->second.second,
key->second.m_aes_key, key->second.m_aes_iv, online_id,
key->second.m_name))
try
{
it = m_pending_connection.erase(it);
m_keys.erase(online_id);
continue;
if (decryptConnectionRequest(peer, it->second.second,
key->second.m_aes_key, key->second.m_aes_iv, online_id,
key->second.m_name))
{
it = m_pending_connection.erase(it);
m_keys.erase(online_id);
continue;
}
else
key->second.m_tried = true;
}
else
catch (std::exception& e)
{
Log::error("ServerLobby",
"handlePendingConnection error: %s", e.what());
key->second.m_tried = true;
}
}
it++;
}