Browse Source

use INT_MAX instead of zero for "no size limit"

this simplifies the actual conditions
wip/maildir-uid-dupes-test
Oswald Buddenhagen 12 years ago
parent
commit
e4243debb6
  1. 2
      src/config.c
  2. 6
      src/sync.c

2
src/config.c

@ -343,6 +343,8 @@ load_config( const char *where, int pseudo )
if (store) { if (store) {
if (!store->path) if (!store->path)
store->path = ""; store->path = "";
if (!store->max_size)
store->max_size = INT_MAX;
*storeapp = store; *storeapp = store;
storeapp = &store->next; storeapp = &store->next;
*storeapp = 0; *storeapp = 0;

6
src/sync.c

@ -941,7 +941,7 @@ box_selected( int sts, void *aux )
opts[1-t] |= OPEN_NEW; opts[1-t] |= OPEN_NEW;
if (chan->ops[t] & OP_EXPUNGE) if (chan->ops[t] & OP_EXPUNGE)
opts[1-t] |= OPEN_FLAGS; opts[1-t] |= OPEN_FLAGS;
if (chan->stores[t]->max_size) if (chan->stores[t]->max_size != INT_MAX)
opts[1-t] |= OPEN_SIZE; opts[1-t] |= OPEN_SIZE;
} }
if (chan->ops[t] & OP_EXPUNGE) { if (chan->ops[t] & OP_EXPUNGE) {
@ -1185,7 +1185,7 @@ box_loaded( int sts, void *aux )
Fprintf( svars->jfp, "+ %d %d\n", srec->uid[M], srec->uid[S] ); Fprintf( svars->jfp, "+ %d %d\n", srec->uid[M], srec->uid[S] );
debug( " -> pair(%d,%d) created\n", srec->uid[M], srec->uid[S] ); debug( " -> pair(%d,%d) created\n", srec->uid[M], srec->uid[S] );
} }
if ((tmsg->flags & F_FLAGGED) || !svars->chan->stores[t]->max_size || tmsg->size <= svars->chan->stores[t]->max_size) { if ((tmsg->flags & F_FLAGGED) || tmsg->size <= svars->chan->stores[t]->max_size) {
if (tmsg->flags) { if (tmsg->flags) {
srec->flags = tmsg->flags; srec->flags = tmsg->flags;
Fprintf( svars->jfp, "* %d %d %u\n", srec->uid[M], srec->uid[S], srec->flags ); Fprintf( svars->jfp, "* %d %d %u\n", srec->uid[M], srec->uid[S], srec->flags );
@ -1558,7 +1558,7 @@ msgs_flags_set( sync_vars_t *svars, int t )
debug( "%s: not trashing message %d - not new\n", str_ms[t], tmsg->uid ); debug( "%s: not trashing message %d - not new\n", str_ms[t], tmsg->uid );
} else { } else {
if (!tmsg->srec || tmsg->srec->uid[1-t] < 0) { if (!tmsg->srec || tmsg->srec->uid[1-t] < 0) {
if (!svars->ctx[1-t]->conf->max_size || tmsg->size <= svars->ctx[1-t]->conf->max_size) { if (tmsg->size <= svars->ctx[1-t]->conf->max_size) {
debug( "%s: remote trashing message %d\n", str_ms[t], tmsg->uid ); debug( "%s: remote trashing message %d\n", str_ms[t], tmsg->uid );
svars->trash_total[t]++; svars->trash_total[t]++;
stats( svars ); stats( svars );

Loading…
Cancel
Save