SSU2: Fix NACK handling when higher than previous highest acked

was treating them as acks
This commit is contained in:
zzz
2022-07-10 13:01:56 -04:00
parent a18a5136b7
commit 8e985eb951
3 changed files with 24 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
2022-07-10 zzz
* SSU2: Fix NACK handling
2022-07-09 zzz
* Console: Only display news if a new entry is found
* SSU2: Support other reason codes in destroy message

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Git";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 10;
public final static long BUILD = 11;
/** for example "-test" */
public final static String EXTRA = "";

View File

@@ -268,8 +268,10 @@ class SSU2Bitfield {
}
// portion that is strictly newer
for (long bit = bf2Highest + 1; bit <= highest; bit++) {
bf2.set(bit);
cb.bitSet(bit);
if (get(bit)) {
bf2.set(bit);
cb.bitSet(bit);
}
}
}
}
@@ -348,9 +350,24 @@ class SSU2Bitfield {
public static void main(String[] args) {
Callback cbi = new CallbackImpl();
int off = 100;
int off = 0;
SSU2Bitfield bf = new SSU2Bitfield(256, off);
System.out.println(bf.toString());
for (int i = 0; i < 20; i++) {
bf.set(i);
}
for (int i = 21; i < 31; i++) {
bf.set(i);
}
bf.set(35);
System.out.println(bf.toString());
System.out.println(bf.toAckBlock(10).toString());
SSU2Bitfield bf2 = new SSU2Bitfield(256, off);
bf2.set(0);
bf.forEachAndNot(bf2, cbi);
if (true) return;
bf.toAckBlock(20);
bf.set(off);