Browse Source

fixed crash

pull/93/head
orignal 10 years ago
parent
commit
ea9aa58471
  1. 11
      Garlic.cpp
  2. 10
      TunnelGateway.cpp

11
Garlic.cpp

@ -295,16 +295,7 @@ namespace garlic @@ -295,16 +295,7 @@ namespace garlic
I2NPMessage * GarlicRouting::WrapSingleMessage (const i2p::data::RoutingDestination& destination, I2NPMessage * msg)
{
auto it = m_Sessions.find (destination.GetIdentHash ());
if (it != m_Sessions.end ())
{
delete it->second;
m_Sessions.erase (it);
}
GarlicRoutingSession * session = new GarlicRoutingSession (&destination, 0); // not follow-on messages expected
m_Sessions[destination.GetIdentHash ()] = session;
return session->WrapSingleMessage (msg, nullptr);
return WrapMessage (destination, msg, nullptr);
}
I2NPMessage * GarlicRouting::WrapMessage (const i2p::data::RoutingDestination& destination,

10
TunnelGateway.cpp

@ -148,13 +148,17 @@ namespace tunnel @@ -148,13 +148,17 @@ namespace tunnel
void TunnelGateway::SendTunnelDataMsg (const TunnelMessageBlock& block)
{
PutTunnelDataMsg (block);
SendBuffer ();
if (block.data)
{
PutTunnelDataMsg (block);
SendBuffer ();
}
}
void TunnelGateway::PutTunnelDataMsg (const TunnelMessageBlock& block)
{
m_Buffer.PutI2NPMsg (block);
if (block.data)
m_Buffer.PutI2NPMsg (block);
}
void TunnelGateway::SendBuffer ()

Loading…
Cancel
Save