commit 05631d8217a1dbc94c6f5e5bb2841b0254d4d9c4
Author: Oswald Buddenhagen <[email protected]>
Date:   Sat May 11 10:12:33 2013 +0200

    use INT_MAX instead of zero for "no size limit"
    
    this simplifies the actual conditions

 src/config.c |    2 ++
 src/sync.c   |    6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/config.c b/src/config.c
index 9e4f766..ac8e0dc 100644
--- a/src/config.c
+++ b/src/config.c
@@ -343,6 +343,8 @@ load_config( const char *where, int pseudo )
                                if (store) {
                                        if (!store->path)
                                                store->path = "";
+                                       if (!store->max_size)
+                                               store->max_size = INT_MAX;
                                        *storeapp = store;
                                        storeapp = &store->next;
                                        *storeapp = 0;
diff --git a/src/sync.c b/src/sync.c
index a263e35..da30625 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -941,7 +941,7 @@ box_selected( int sts, void *aux )
                                opts[1-t] |= OPEN_NEW;
                        if (chan->ops[t] & OP_EXPUNGE)
                                opts[1-t] |= OPEN_FLAGS;
-                       if (chan->stores[t]->max_size)
+                       if (chan->stores[t]->max_size != INT_MAX)
                                opts[1-t] |= OPEN_SIZE;
                }
                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] );
                                                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) {
                                                        srec->flags = 
tmsg->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 );
                                } else {
                                        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 );
                                                        svars->trash_total[t]++;
                                                        stats( svars );

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to