mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
delivery type Destination for garlic cloves
This commit is contained in:
parent
7f92a847c2
commit
01cb5e02e9
4 changed files with 19 additions and 3 deletions
14
Garlic.cpp
14
Garlic.cpp
|
@ -95,8 +95,18 @@ namespace garlic
|
|||
size_t size = 0;
|
||||
payload[size] = 1; // 1 clove
|
||||
size++;
|
||||
payload[size] = 0;// delivery instructions flag
|
||||
size++;
|
||||
if (m_Destination->IsDestination ())
|
||||
{
|
||||
payload[size] = eGarlicDeliveryTypeDestination << 5;// delivery instructions flag destination
|
||||
size++;
|
||||
memcpy (payload + size, m_Destination->GetIdentHash (), 32);
|
||||
size += 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
payload[size] = 0;// delivery instructions flag local
|
||||
size++;
|
||||
}
|
||||
memcpy (payload + size, msg->GetBuffer (), msg->GetLength ());
|
||||
size += msg->GetLength ();
|
||||
*(uint32_t *)(payload + size) = htobe32 (m_Rnd.GenerateWord32 ()); // CloveID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue