Переглянути джерело

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.
Oswald Buddenhagen 8 роки тому
батько
коміт
5c2ce59217
1 змінених файлів з 5 додано та 0 видалено
  1. 5 0
      src/sync.c

+ 5 - 0
src/sync.c

@@ -1615,6 +1615,11 @@ box_loaded( int sts, void *aux )
 							jFprintf( svars, "* %d %d %u\n", srec->uid[M], srec->uid[S], srec->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++) {
 							t2 = arc4_getbyte() & 0x3f;
 							srec->tuid[t1] = t2 < 26 ? t2 + 'A' : t2 < 52 ? t2 + 'a' - 26 : t2 < 62 ? t2 + '0' - 52 : t2 == 62 ? '+' : '/';