mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
fixed crash
This commit is contained in:
parent
bd9e68e69f
commit
7949ffe41e
1
SSU.cpp
1
SSU.cpp
|
@ -256,6 +256,7 @@ namespace transport
|
|||
|
||||
std::shared_ptr<SSUSession> SSUServer::FindSession (const boost::asio::ip::udp::endpoint& e) const
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_SessionsMutex);
|
||||
auto it = m_Sessions.find (e);
|
||||
if (it != m_Sessions.end ())
|
||||
return it->second;
|
||||
|
|
2
SSU.h
2
SSU.h
|
@ -96,7 +96,7 @@ namespace transport
|
|||
boost::asio::ip::udp::socket m_Socket, m_SocketV6;
|
||||
boost::asio::deadline_timer m_IntroducersUpdateTimer, m_PeerTestsCleanupTimer;
|
||||
std::list<boost::asio::ip::udp::endpoint> m_Introducers; // introducers we are connected to
|
||||
std::mutex m_SessionsMutex;
|
||||
mutable std::mutex m_SessionsMutex;
|
||||
std::map<boost::asio::ip::udp::endpoint, std::shared_ptr<SSUSession> > m_Sessions;
|
||||
std::map<uint32_t, boost::asio::ip::udp::endpoint> m_Relays; // we are introducer
|
||||
std::map<uint32_t, PeerTest> m_PeerTests; // nonce -> creation time in milliseconds
|
||||
|
|
|
@ -1076,7 +1076,14 @@ namespace transport
|
|||
uint8_t buf[48 + 18];
|
||||
// encrypt message with session key
|
||||
FillHeaderAndEncrypt (PAYLOAD_TYPE_SESSION_DESTROYED, buf, 48);
|
||||
Send (buf, 48);
|
||||
try
|
||||
{
|
||||
Send (buf, 48);
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
LogPrint (eLogError, "SSU send session destoriyed exception ", ex.what ());
|
||||
}
|
||||
LogPrint (eLogDebug, "SSU session destroyed sent");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue