mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-08 22:57:52 +00:00
Merge pull request #774 from majestrate/datagram-fix-2017-01-13
try fixing crash in datagram code
This commit is contained in:
commit
10d2f0a565
@ -45,7 +45,8 @@ namespace datagram
|
|||||||
owner->Sign (buf1, len, signature);
|
owner->Sign (buf1, len, signature);
|
||||||
|
|
||||||
auto msg = CreateDataMessage (buf, len + headerLen, fromPort, toPort);
|
auto msg = CreateDataMessage (buf, len + headerLen, fromPort, toPort);
|
||||||
ObtainSession(identity)->SendMsg(msg);
|
auto session = ObtainSession(identity);
|
||||||
|
session->SendMsg(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -69,7 +70,8 @@ namespace datagram
|
|||||||
if (verified)
|
if (verified)
|
||||||
{
|
{
|
||||||
auto h = identity.GetIdentHash();
|
auto h = identity.GetIdentHash();
|
||||||
ObtainSession(h)->Ack();
|
auto session = ObtainSession(h);
|
||||||
|
session->Ack();
|
||||||
auto r = FindReceiver(toPort);
|
auto r = FindReceiver(toPort);
|
||||||
if(r)
|
if(r)
|
||||||
r(identity, fromPort, toPort, buf + headerLen, len -headerLen);
|
r(identity, fromPort, toPort, buf + headerLen, len -headerLen);
|
||||||
@ -332,7 +334,7 @@ namespace datagram
|
|||||||
{
|
{
|
||||||
boost::posix_time::milliseconds dlt(100);
|
boost::posix_time::milliseconds dlt(100);
|
||||||
m_SendQueueTimer.expires_from_now(dlt);
|
m_SendQueueTimer.expires_from_now(dlt);
|
||||||
m_SendQueueTimer.async_wait([&](const boost::system::error_code & ec) { if(ec) return; FlushSendQueue(); });
|
m_SendQueueTimer.async_wait([this](const boost::system::error_code & ec) { if(ec) return; FlushSendQueue(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user