mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Fix even more alignment problems
This commit is contained in:
parent
cbfe8b8232
commit
84f7966a0b
9 changed files with 96 additions and 66 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <string.h>
|
||||
#include "I2PEndian.h"
|
||||
#include <thread>
|
||||
#include <algorithm>
|
||||
|
@ -41,6 +42,7 @@ namespace tunnel
|
|||
std::random_shuffle (recordIndicies.begin(), recordIndicies.end());
|
||||
|
||||
// create real records
|
||||
//TODO: this is likely to arise alignment issues but I need to see how I fix it
|
||||
I2NPBuildRequestRecordElGamalEncrypted * records = (I2NPBuildRequestRecordElGamalEncrypted *)(msg->GetPayload () + 1);
|
||||
TunnelHopConfig * hop = m_Config->GetFirstHop ();
|
||||
int i = 0;
|
||||
|
@ -126,9 +128,10 @@ namespace tunnel
|
|||
hop = m_Config->GetFirstHop ();
|
||||
while (hop)
|
||||
{
|
||||
I2NPBuildResponseRecord * record = (I2NPBuildResponseRecord *)(msg + 1 + hop->recordIndex*sizeof (I2NPBuildResponseRecord));
|
||||
LogPrint ("Ret code=", (int)record->ret);
|
||||
if (record->ret)
|
||||
I2NPBuildResponseRecord record;
|
||||
memcpy (&record, msg + 1 + hop->recordIndex*sizeof (I2NPBuildResponseRecord), sizeof (I2NPBuildResponseRecord));
|
||||
LogPrint ("Ret code=", (int)record.ret);
|
||||
if (record.ret)
|
||||
// if any of participants declined the tunnel is not established
|
||||
established = false;
|
||||
hop = hop->next;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue