mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
proper bitfields order
This commit is contained in:
parent
d3081a4e03
commit
5ea3e70c3a
@ -71,7 +71,7 @@ namespace ssu
|
||||
{
|
||||
int numSentFragments = it->second->fragments.size ();
|
||||
// process bits
|
||||
uint8_t mask = 0x40;
|
||||
uint8_t mask = 0x01;
|
||||
for (int j = 0; j < 7; j++)
|
||||
{
|
||||
if (bitfield & mask)
|
||||
@ -83,7 +83,7 @@ namespace ssu
|
||||
}
|
||||
}
|
||||
fragment++;
|
||||
mask >>= 1;
|
||||
mask <<= 1;
|
||||
}
|
||||
}
|
||||
buf++;
|
||||
@ -331,7 +331,7 @@ namespace ssu
|
||||
div_t d = div (fragmentNum, 7);
|
||||
memset (payload, 0x80, d.quot); // 0x80 means non-last
|
||||
payload += d.quot;
|
||||
*payload = 0x40 >> d.rem; // set corresponding bit
|
||||
*payload = 0x01 << d.rem; // set corresponding bit
|
||||
payload++;
|
||||
*payload = 0; // number of fragments
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user