fix sync resumption with re-newed messages

the UID of the entries needs to be bumped from -1 to -2, as otherwise
the resumed run would see a TUID in a sync entry which may not have one.
This commit is contained in:
Oswald Buddenhagen 2017-03-30 19:48:08 +02:00
parent 7c466fc3e7
commit 5c2ce59217

View File

@ -1615,6 +1615,11 @@ box_loaded( int sts, void *aux )
jFprintf( svars, "* %d %d %u\n", srec->uid[M], srec->uid[S], srec->flags ); jFprintf( svars, "* %d %d %u\n", srec->uid[M], srec->uid[S], srec->flags );
debug( " -> updated flags to %u\n", tmsg->flags ); debug( " -> updated flags to %u\n", tmsg->flags );
} }
if (srec->uid[t] == -1) {
debug( " -> not too big any more\n" );
jFprintf( svars, "%c %d %d -2\n", "<>"[t], srec->uid[M], srec->uid[S] );
srec->uid[t] = -2;
}
for (t1 = 0; t1 < TUIDL; t1++) { for (t1 = 0; t1 < TUIDL; t1++) {
t2 = arc4_getbyte() & 0x3f; t2 = arc4_getbyte() & 0x3f;
srec->tuid[t1] = t2 < 26 ? t2 + 'A' : t2 < 52 ? t2 + 'a' - 26 : t2 < 62 ? t2 + '0' - 52 : t2 == 62 ? '+' : '/'; srec->tuid[t1] = t2 < 26 ? t2 + 'A' : t2 < 52 ? t2 + 'a' - 26 : t2 < 62 ? t2 + '0' - 52 : t2 == 62 ? '+' : '/';