From 06088ff7a2255b9dbf3da1f5cd2afca43a691123 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 13 Mar 2014 07:43:54 -0400 Subject: [PATCH] fixed crash and few other small issues --- Garlic.cpp | 2 +- HTTPServer.cpp | 13 ++++++++----- SSU.cpp | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Garlic.cpp b/Garlic.cpp index 32639142..3e336092 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -218,7 +218,7 @@ namespace garlic } GarlicRouting routing; - GarlicRouting::GarlicRouting () + GarlicRouting::GarlicRouting (): m_IsRunning (false), m_Thread (nullptr) { } diff --git a/HTTPServer.cpp b/HTTPServer.cpp index ec655709..e8620f09 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -121,13 +121,16 @@ namespace util s << "Our external address:" << "
" << "
"; for (auto& address : i2p::context.GetRouterInfo().GetAddresses()) { - switch (address.transportStyle) { - case i2p::data::RouterInfo::eTransportNTCP: - s << "NTCP  "; + switch (address.transportStyle) + { + case i2p::data::RouterInfo::eTransportNTCP: + s << "NTCP  "; break; - case i2p::data::RouterInfo::eTransportSSU: - s << "SSU     "; + case i2p::data::RouterInfo::eTransportSSU: + s << "SSU     "; break; + default: + s << "Unknown  "; } s << address.host.to_string() << ":" << address.port << "
"; } diff --git a/SSU.cpp b/SSU.cpp index 7efd14e4..196c0a72 100644 --- a/SSU.cpp +++ b/SSU.cpp @@ -853,8 +853,9 @@ namespace ssu auto it = m_Sessions.find (oldEndpoint); if (it != m_Sessions.end ()) { + auto session = it->second; m_Sessions.erase (it); - m_Sessions[newEndpoint] = it->second; + m_Sessions[newEndpoint] = session; LogPrint ("SSU session ressigned from ", oldEndpoint.address ().to_string (), ":", oldEndpoint.port (), " to ", newEndpoint.address ().to_string (), ":", newEndpoint.port ()); }