This commit is contained in:
zugz (tox) 2019-12-24 00:00:00 +00:00
parent 683bc802e2
commit e6cbe907ac
No known key found for this signature in database
GPG Key ID: 6F2BDA289D04F249

View File

@ -2930,20 +2930,17 @@ 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].top_lossy_number = message_number;
g->group[peer_index].bottom_lossy_number = (message_number - MAX_LOSSY_COUNT) + 1; 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].recv_lossy[message_number % MAX_LOSSY_COUNT] = 1;
}
return 0; return 0;