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
12
NetDb.cpp
12
NetDb.cpp
|
@ -1,3 +1,4 @@
|
|||
#include <string.h>
|
||||
#include "I2PEndian.h"
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
@ -424,14 +425,15 @@ namespace data
|
|||
{
|
||||
const uint8_t * buf = m->GetPayload ();
|
||||
size_t len = be16toh (m->GetHeader ()->size);
|
||||
I2NPDatabaseStoreMsg * msg = (I2NPDatabaseStoreMsg *)buf;
|
||||
I2NPDatabaseStoreMsg msg;
|
||||
memcpy (&msg, buf, sizeof (I2NPDatabaseStoreMsg));
|
||||
size_t offset = sizeof (I2NPDatabaseStoreMsg);
|
||||
if (msg->replyToken)
|
||||
if (msg.replyToken)
|
||||
offset += 36;
|
||||
if (msg->type)
|
||||
if (msg.type)
|
||||
{
|
||||
LogPrint ("LeaseSet");
|
||||
AddLeaseSet (msg->key, buf + offset, len - offset, m->from);
|
||||
AddLeaseSet (msg.key, buf + offset, len - offset, m->from);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -449,7 +451,7 @@ namespace data
|
|||
uint8_t uncompressed[2048];
|
||||
size_t uncomressedSize = decompressor.MaxRetrievable ();
|
||||
decompressor.Get (uncompressed, uncomressedSize);
|
||||
AddRouterInfo (msg->key, uncompressed, uncomressedSize);
|
||||
AddRouterInfo (msg.key, uncompressed, uncomressedSize);
|
||||
}
|
||||
i2p::DeleteI2NPMessage (m);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue