Skip to content

Commit

Permalink
fixed possible deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Jan 24, 2024
1 parent a2249f0 commit c5a1806
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions libi2pd_client/UDPTunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ namespace client
void I2PUDPServerTunnel::HandleRecvFromI2P(const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len)
{
if (!m_LastSession || m_LastSession->Identity.GetLL()[0] != from.GetIdentHash ().GetLL()[0] || fromPort != m_LastSession->RemotePort)
{
std::lock_guard<std::mutex> lock(m_SessionsMutex);
m_LastSession = ObtainUDPSession(from, toPort, fromPort);
}
m_LastSession->IPSocket.send_to(boost::asio::buffer(buf, len), m_RemoteEndpoint);
m_LastSession->LastActivity = i2p::util::GetMillisecondsSinceEpoch();
}
Expand Down

0 comments on commit c5a1806

Please sign in to comment.