mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
send SSU DeliveryStatus
This commit is contained in:
parent
53230a4051
commit
b9031c331d
@ -70,8 +70,17 @@ namespace i2p
|
|||||||
I2NPMessage * CreateDeliveryStatusMsg (uint32_t msgID)
|
I2NPMessage * CreateDeliveryStatusMsg (uint32_t msgID)
|
||||||
{
|
{
|
||||||
I2NPDeliveryStatusMsg msg;
|
I2NPDeliveryStatusMsg msg;
|
||||||
msg.msgID = htobe32 (msgID);
|
if (msgID)
|
||||||
msg.timestamp = htobe64 (i2p::util::GetMillisecondsSinceEpoch ());
|
{
|
||||||
|
msg.msgID = htobe32 (msgID);
|
||||||
|
msg.timestamp = htobe64 (i2p::util::GetMillisecondsSinceEpoch ());
|
||||||
|
}
|
||||||
|
else // for SSU establishment
|
||||||
|
{
|
||||||
|
auto rnd = i2p::context.GetRandomNumberGenerator ();
|
||||||
|
msg.msgID = htobe32 (rnd.GenerateWord32 ());
|
||||||
|
msg.timestamp = htobe64 (2); // netID = 2
|
||||||
|
}
|
||||||
return CreateI2NPMessage (eI2NPDeliveryStatus, (uint8_t *)&msg, sizeof (msg));
|
return CreateI2NPMessage (eI2NPDeliveryStatus, (uint8_t *)&msg, sizeof (msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ namespace data
|
|||||||
// caps
|
// caps
|
||||||
WriteString ("caps", properties);
|
WriteString ("caps", properties);
|
||||||
properties << '=';
|
properties << '=';
|
||||||
WriteString ("BC", properties); // TODO:
|
WriteString ("B", properties); // TODO: should be 'BC' for introducers
|
||||||
properties << ';';
|
properties << ';';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
2
SSU.cpp
2
SSU.cpp
@ -176,7 +176,7 @@ namespace ssu
|
|||||||
m_State = eSessionStateConfirmedReceived;
|
m_State = eSessionStateConfirmedReceived;
|
||||||
LogPrint ("Session confirmed received");
|
LogPrint ("Session confirmed received");
|
||||||
m_State = eSessionStateEstablished;
|
m_State = eSessionStateEstablished;
|
||||||
// TODO: send DeliverStatus
|
SendI2NPMessage (CreateDeliveryStatusMsg (0));
|
||||||
Established ();
|
Established ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user