mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 06:54:15 +00:00
fixed crash
This commit is contained in:
parent
d231e59f0c
commit
ea9aa58471
11
Garlic.cpp
11
Garlic.cpp
@ -295,16 +295,7 @@ namespace garlic
|
|||||||
|
|
||||||
I2NPMessage * GarlicRouting::WrapSingleMessage (const i2p::data::RoutingDestination& destination, I2NPMessage * msg)
|
I2NPMessage * GarlicRouting::WrapSingleMessage (const i2p::data::RoutingDestination& destination, I2NPMessage * msg)
|
||||||
{
|
{
|
||||||
auto it = m_Sessions.find (destination.GetIdentHash ());
|
return WrapMessage (destination, msg, nullptr);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
I2NPMessage * GarlicRouting::WrapMessage (const i2p::data::RoutingDestination& destination,
|
I2NPMessage * GarlicRouting::WrapMessage (const i2p::data::RoutingDestination& destination,
|
||||||
|
@ -147,13 +147,17 @@ namespace tunnel
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TunnelGateway::SendTunnelDataMsg (const TunnelMessageBlock& block)
|
void TunnelGateway::SendTunnelDataMsg (const TunnelMessageBlock& block)
|
||||||
|
{
|
||||||
|
if (block.data)
|
||||||
{
|
{
|
||||||
PutTunnelDataMsg (block);
|
PutTunnelDataMsg (block);
|
||||||
SendBuffer ();
|
SendBuffer ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TunnelGateway::PutTunnelDataMsg (const TunnelMessageBlock& block)
|
void TunnelGateway::PutTunnelDataMsg (const TunnelMessageBlock& block)
|
||||||
{
|
{
|
||||||
|
if (block.data)
|
||||||
m_Buffer.PutI2NPMsg (block);
|
m_Buffer.PutI2NPMsg (block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user