Browse Source

send SSU DeliveryStatus

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

13
I2NPProtocol.cpp

@ -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));
} }

2
RouterInfo.cpp

@ -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

@ -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…
Cancel
Save