mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
use linked list for out of sequence fragments
This commit is contained in:
parent
6ca6591c43
commit
bc888167a7
2 changed files with 35 additions and 36 deletions
|
@ -171,18 +171,19 @@ namespace transport
|
|||
{
|
||||
uint8_t buf[SSU2_MAX_PACKET_SIZE];
|
||||
size_t len;
|
||||
int fragmentNum;
|
||||
bool isLast;
|
||||
std::shared_ptr<Fragment> next;
|
||||
};
|
||||
|
||||
std::shared_ptr<I2NPMessage> msg;
|
||||
int nextFragmentNum;
|
||||
uint32_t lastFragmentInsertTime; // in seconds
|
||||
std::shared_ptr<Fragment> secondFragment; // fragment #1
|
||||
std::unique_ptr<std::map<int, std::shared_ptr<Fragment> > > outOfSequenceFragments; // fragments #2 and more
|
||||
std::shared_ptr<Fragment> outOfSequenceFragments; // #1 and more
|
||||
|
||||
void AttachNextFragment (const uint8_t * fragment, size_t fragmentSize);
|
||||
bool ConcatOutOfSequenceFragments (); // true if message complete
|
||||
void AddOutOfSequenceFragment (int fragmentNum, std::shared_ptr<Fragment> fragment);
|
||||
void AddOutOfSequenceFragment (std::shared_ptr<Fragment> fragment);
|
||||
};
|
||||
|
||||
struct SSU2SentPacket
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue