mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
make sure DeliveryStatus and DatabseStore are sent first
This commit is contained in:
parent
e3764bef37
commit
f846b87590
@ -298,7 +298,6 @@ namespace transport
|
||||
sentMessage->nextResendTime = i2p::util::GetSecondsSinceEpoch () + RESEND_INTERVAL;
|
||||
sentMessage->numResends = 0;
|
||||
auto& fragments = sentMessage->fragments;
|
||||
msgID = htobe32 (msgID);
|
||||
size_t payloadSize = m_PacketSize - sizeof (SSUHeader) - 9; // 9 = flag + #frg(1) + messageID(4) + frag info (3)
|
||||
size_t len = msg->GetLength ();
|
||||
uint8_t * msgBuf = msg->GetSSUHeader ();
|
||||
@ -314,7 +313,7 @@ namespace transport
|
||||
payload++;
|
||||
*payload = 1; // always 1 message fragment per message
|
||||
payload++;
|
||||
*(uint32_t *)payload = msgID;
|
||||
htobe32buf (payload, msgID);
|
||||
payload += 4;
|
||||
bool isLast = (len <= payloadSize);
|
||||
size_t size = isLast ? len : payloadSize;
|
||||
|
@ -255,7 +255,7 @@ namespace transport
|
||||
if (paddingSize > 0) paddingSize = 16 - paddingSize;
|
||||
payload += paddingSize;
|
||||
// TODO: verify signature (need data from session request), payload points to signature
|
||||
SendI2NPMessage (CreateDeliveryStatusMsg (0));
|
||||
m_Data.Send (CreateDeliveryStatusMsg (0));
|
||||
Established ();
|
||||
}
|
||||
|
||||
@ -767,7 +767,7 @@ namespace transport
|
||||
delete m_DHKeysPair;
|
||||
m_DHKeysPair = nullptr;
|
||||
}
|
||||
SendI2NPMessage (CreateDatabaseStoreMsg ());
|
||||
m_Data.Send (CreateDatabaseStoreMsg ());
|
||||
transports.PeerConnected (shared_from_this ());
|
||||
if (m_PeerTest && (m_RemoteRouter && m_RemoteRouter->IsPeerTesting ()))
|
||||
SendPeerTest ();
|
||||
|
Loading…
Reference in New Issue
Block a user