Skip to content

Commit

Permalink
drop buffer upon peer disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Jan 22, 2025
1 parent b3d0951 commit ca0818a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libi2pd/Transports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,13 @@ namespace transport
}
else
{
std::lock_guard<std::mutex> l(m_PeersMutex);
m_Peers.erase (it);
{
std::lock_guard<std::mutex> l(m_PeersMutex);
m_Peers.erase (it);
}
// delete buffer of just disconnected router
auto r = i2p::data::netdb.FindRouter (ident);
if (r && !r->IsUpdated ()) r->ScheduleBufferToDelete ();
}
}
}
Expand Down

0 comments on commit ca0818a

Please sign in to comment.