mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
refactor
This commit is contained in:
parent
683bc802e2
commit
e6cbe907ac
|
@ -2930,21 +2930,18 @@ static unsigned int lossy_packet_not_received(const Group_c *g, int peer_index,
|
||||||
|
|
||||||
if (top_distance >= MAX_LOSSY_COUNT) {
|
if (top_distance >= MAX_LOSSY_COUNT) {
|
||||||
crypto_memzero(g->group[peer_index].recv_lossy, sizeof(g->group[peer_index].recv_lossy));
|
crypto_memzero(g->group[peer_index].recv_lossy, sizeof(g->group[peer_index].recv_lossy));
|
||||||
g->group[peer_index].top_lossy_number = message_number;
|
|
||||||
g->group[peer_index].bottom_lossy_number = (message_number - MAX_LOSSY_COUNT) + 1;
|
|
||||||
g->group[peer_index].recv_lossy[message_number % MAX_LOSSY_COUNT] = 1;
|
|
||||||
} else { // top_distance < MAX_LOSSY_COUNT
|
} else { // top_distance < MAX_LOSSY_COUNT
|
||||||
for (unsigned int i = g->group[peer_index].bottom_lossy_number;
|
for (unsigned int i = g->group[peer_index].bottom_lossy_number;
|
||||||
i != g->group[peer_index].bottom_lossy_number + top_distance;
|
i != g->group[peer_index].bottom_lossy_number + top_distance;
|
||||||
++i) {
|
++i) {
|
||||||
g->group[peer_index].recv_lossy[i % MAX_LOSSY_COUNT] = 0;
|
g->group[peer_index].recv_lossy[i % MAX_LOSSY_COUNT] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
g->group[peer_index].top_lossy_number = message_number;
|
|
||||||
g->group[peer_index].bottom_lossy_number = (message_number - MAX_LOSSY_COUNT) + 1;
|
|
||||||
g->group[peer_index].recv_lossy[message_number % MAX_LOSSY_COUNT] = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g->group[peer_index].top_lossy_number = message_number;
|
||||||
|
g->group[peer_index].bottom_lossy_number = (message_number - MAX_LOSSY_COUNT) + 1;
|
||||||
|
g->group[peer_index].recv_lossy[message_number % MAX_LOSSY_COUNT] = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user