Browse Source

send SSU DeliveryStatus

pull/46/head
orignal 11 years ago
parent
commit
b9031c331d
  1. 9
      I2NPProtocol.cpp
  2. 2
      RouterInfo.cpp
  3. 2
      SSU.cpp

9
I2NPProtocol.cpp

@ -70,8 +70,17 @@ namespace i2p @@ -70,8 +70,17 @@ namespace i2p
I2NPMessage * CreateDeliveryStatusMsg (uint32_t msgID)
{
I2NPDeliveryStatusMsg msg;
if (msgID)
{
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));
}

2
RouterInfo.cpp

@ -217,7 +217,7 @@ namespace data @@ -217,7 +217,7 @@ namespace data
// caps
WriteString ("caps", properties);
properties << '=';
WriteString ("BC", properties); // TODO:
WriteString ("B", properties); // TODO: should be 'BC' for introducers
properties << ';';
}
else

2
SSU.cpp

@ -176,7 +176,7 @@ namespace ssu @@ -176,7 +176,7 @@ namespace ssu
m_State = eSessionStateConfirmedReceived;
LogPrint ("Session confirmed received");
m_State = eSessionStateEstablished;
// TODO: send DeliverStatus
SendI2NPMessage (CreateDeliveryStatusMsg (0));
Established ();
}
else

Loading…
Cancel
Save