From 74e6da0bdb6c14ef0d9fc3a67d4267c1314ee04b Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 19 Sep 2013 12:02:34 +0200 Subject: [PATCH] purge archive size update fix --- src/pilerpurge.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pilerpurge.c b/src/pilerpurge.c index 4956fe42..6625f677 100644 --- a/src/pilerpurge.c +++ b/src/pilerpurge.c @@ -261,10 +261,11 @@ int purge_messages_without_attachment(struct session_data *sdata, struct __data memcpy(&update_meta_sql[strlen(update_meta_sql)], id, strlen(id)); memcpy(&update_meta_sql[strlen(update_meta_sql)], ",", 1); + purged_size += size; + if(strlen(buf) >= sizeof(buf)-RND_STR_LEN-2-1){ purged += remove_message_frame_files(buf, update_meta_sql, sdata, cfg); - purged_size += size; memset(buf, 0, sizeof(buf)); memset(update_meta_sql, 0, sizeof(update_meta_sql)); @@ -317,9 +318,10 @@ int purge_messages_with_attachments(struct session_data *sdata, struct __data *d memcpy(&idlist[strlen(idlist)], s, strlen(s)); memcpy(&idlist[strlen(idlist)], "','", 3); + purged_size += size; + if(strlen(idlist) >= sizeof(idlist)-2*RND_STR_LEN){ purged += remove_attachments(idlist, sdata, data, cfg); - purged_size += size; memset(idlist, 0, sizeof(idlist)); }