Commit 181e7c96 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Start of ForwardPacketTable is moved upon expiry.

parent 45ae311f
Pipeline #1464 passed with stages
in 2 minutes and 11 seconds
......@@ -425,10 +425,7 @@ bool PrrtSocket_cleanup(PrrtSocket *socket) {
prrtSequenceNumber_t lastSequenceNumberBase = (prrtSequenceNumber_t) (last->sequenceNumber -
last->index - 1);
for (i = 0; i < (lastSequenceNumberBase - firstSequenceNumberBase); i++) {
PrrtForwardPacketTable_test_set_is_number_relevant(socket->forwardPacketTable,
(prrtSequenceNumber_t) (firstSequenceNumberBase + i));
}
PrrtForwardPacketTable_forward_start(socket->forwardPacketTable, lastSequenceNumberBase);
PrrtRepairBlockStore_expire_block_range(socket->repairBlockStore, firstSequenceNumberBase,
lastSequenceNumberBase);
......
......@@ -83,3 +83,17 @@ bool PrrtForwardPacketTable_test_is_block_relevant(PrrtForwardPacketTable *forwa
return res;
}
void PrrtForwardPacketTable_forward_start(PrrtForwardPacketTable *fpt_ptr, prrtSequenceNumber_t new_start)
{
prrtSequenceNumber_t seqno = fpt_ptr->start;
while (seqno != new_start) {
Bitmap_set(fpt_ptr->bitmap, seqno, true);
seqno++;
}
// TODO: make more efficient by using the Bitmap_set_range function
fpt_ptr->start = seqno;
}
\ No newline at end of file
......@@ -19,4 +19,6 @@ bool PrrtForwardPacketTable_test_set_is_number_relevant(PrrtForwardPacketTable *
bool PrrtForwardPacketTable_test_is_block_relevant(PrrtForwardPacketTable *forwardPacketTable, prrtSequenceNumber_t start,
prrtSequenceNumber_t length);
void PrrtForwardPacketTable_forward_start(PrrtForwardPacketTable *fpt_ptr, prrtSequenceNumber_t new_start);
#endif //PRRT_FORWARD_PACKET_TABLE_H
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment