Fixed the bug that caused all the lost acks. We just gave the new acks a random id, but we didnt check if we already had an ack with that id.

This commit is contained in:
senft-desktop 2012-11-30 16:27:21 +01:00
parent d7d9ba242e
commit 76fde044e3

View File

@ -106,6 +106,9 @@ public class Node {
*/
private Ack generateAck(final SocketAddress addr) {
int ack_id = generator.nextInt();
while (acks.containsKey(ack_id)) {
ack_id = generator.nextInt();
}
Ack newAck = new Ack(ack_id, addr, channel);
acks.put(ack_id, newAck);