mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
handle error for SessionConfrimed send
This commit is contained in:
parent
b7f17d4cb1
commit
9a7aed20e9
@ -602,20 +602,29 @@ namespace transport
|
|||||||
|
|
||||||
void NTCP2Session::HandleSessionConfirmedSent (const boost::system::error_code& ecode, std::size_t bytes_transferred)
|
void NTCP2Session::HandleSessionConfirmedSent (const boost::system::error_code& ecode, std::size_t bytes_transferred)
|
||||||
{
|
{
|
||||||
LogPrint (eLogDebug, "NTCP2: SessionConfirmed sent");
|
(void) bytes_transferred;
|
||||||
KeyDerivationFunctionDataPhase ();
|
if (ecode)
|
||||||
// Alice data phase keys
|
{
|
||||||
m_SendKey = m_Kab;
|
LogPrint (eLogWarning, "NTCP2: couldn't send SessionConfirmed message: ", ecode.message ());
|
||||||
m_ReceiveKey = m_Kba;
|
Terminate ();
|
||||||
SetSipKeys (m_Sipkeysab, m_Sipkeysba);
|
}
|
||||||
memcpy (m_ReceiveIV.buf, m_Sipkeysba + 16, 8);
|
else
|
||||||
memcpy (m_SendIV.buf, m_Sipkeysab + 16, 8);
|
{
|
||||||
Established ();
|
LogPrint (eLogDebug, "NTCP2: SessionConfirmed sent");
|
||||||
ReceiveLength ();
|
KeyDerivationFunctionDataPhase ();
|
||||||
|
// Alice data phase keys
|
||||||
|
m_SendKey = m_Kab;
|
||||||
|
m_ReceiveKey = m_Kba;
|
||||||
|
SetSipKeys (m_Sipkeysab, m_Sipkeysba);
|
||||||
|
memcpy (m_ReceiveIV.buf, m_Sipkeysba + 16, 8);
|
||||||
|
memcpy (m_SendIV.buf, m_Sipkeysab + 16, 8);
|
||||||
|
Established ();
|
||||||
|
ReceiveLength ();
|
||||||
|
|
||||||
// TODO: remove
|
// TODO: remove
|
||||||
// m_SendQueue.push_back (CreateDeliveryStatusMsg (1));
|
// m_SendQueue.push_back (CreateDeliveryStatusMsg (1));
|
||||||
// SendQueue ();
|
// SendQueue ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NTCP2Session::HandleSessionCreatedSent (const boost::system::error_code& ecode, std::size_t bytes_transferred)
|
void NTCP2Session::HandleSessionCreatedSent (const boost::system::error_code& ecode, std::size_t bytes_transferred)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user