From a80e4ef0ea290907dc1e5275f4e438dedafd2c7a Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 7 Feb 2015 17:58:29 -0500 Subject: [PATCH] fixed memory leak --- HTTPServer.cpp | 2 ++ SSUData.cpp | 5 +++++ SSUData.h | 3 ++- SSUSession.cpp | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/HTTPServer.cpp b/HTTPServer.cpp index 7eeb47e7..77585039 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -743,6 +743,8 @@ namespace util s << endpoint.address ().to_string () << ":" << endpoint.port (); if (!outgoing) s << "-->"; s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]"; + if (it.second->GetRelayTag ()) + s << " [itag:" << it.second->GetRelayTag () << "]"; s << "
"; s << std::endl; } diff --git a/SSUData.cpp b/SSUData.cpp index 5bdb9702..58387a07 100644 --- a/SSUData.cpp +++ b/SSUData.cpp @@ -28,6 +28,11 @@ namespace transport delete it.second; } + void SSUData::Stop () + { + m_ResendTimer.cancel (); + } + void SSUData::AdjustPacketSize (const i2p::data::RouterInfo& remoteRouter) { auto ssuAddress = remoteRouter.GetSSUAddress (); diff --git a/SSUData.h b/SSUData.h index ec94abd0..021c5bf1 100644 --- a/SSUData.h +++ b/SSUData.h @@ -78,7 +78,8 @@ namespace transport SSUData (SSUSession& session); ~SSUData (); - + void Stop (); + void ProcessMessage (uint8_t * buf, size_t len); void Send (i2p::I2NPMessage * msg); diff --git a/SSUSession.cpp b/SSUSession.cpp index 4c7d08cd..d360baf3 100644 --- a/SSUSession.cpp +++ b/SSUSession.cpp @@ -763,6 +763,7 @@ namespace transport m_State = eSessionStateClosed; SendSesionDestroyed (); transports.PeerDisconnected (shared_from_this ()); + m_Data.Stop (); m_Timer.cancel (); }