From 58f6efb7eca25a4b1371b5149a6a8b870f2e9b70 Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 30 Jul 2015 13:23:43 +0200 Subject: [PATCH] fixed an import related sql logging bug --- src/config.h | 2 +- src/imap.c | 13 +++++++------ src/mysql.c | 4 ---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/config.h b/src/config.h index 94757396..a6e3d040 100644 --- a/src/config.h +++ b/src/config.h @@ -14,7 +14,7 @@ #define VERSION "1.2.0-master" -#define BUILD 915 +#define BUILD 916 #define HOSTID "mailarchiver" diff --git a/src/imap.c b/src/imap.c index ebaecc64..650b699a 100644 --- a/src/imap.c +++ b/src/imap.c @@ -234,14 +234,15 @@ int process_imap_folder(int sd, int *seq, char *folder, struct session_data *sda close(fd); - if(dryrun == 0 && msglen > 10) rc = import_message(filename, sdata, data, cfg); - else rc = OK; + if(dryrun == 0 && msglen > 10){ + rc = import_message(filename, sdata, data, cfg); - - if(data->import->processed_messages % 100 == 0){ - time(&(data->import->updated)); - update_import_job_stat(sdata, data); + if(data->import->processed_messages % 100 == 0){ + time(&(data->import->updated)); + update_import_job_stat(sdata, data); + } } + else rc = OK; if(rc == ERR) printf("error importing '%s'\n", filename); diff --git a/src/mysql.c b/src/mysql.c index 54607572..48406e1d 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -48,8 +48,6 @@ void p_bind_init(struct __data *data){ void p_query(struct session_data *sdata, char *s, struct __config *cfg){ - if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: p_query=%s", sdata->ttmpfile, s); - mysql_real_query(&(sdata->mysql), s, strlen(s)); } @@ -212,8 +210,6 @@ int p_get_affected_rows(MYSQL_STMT *stmt){ int prepare_sql_statement(struct session_data *sdata, MYSQL_STMT **stmt, char *s, struct __config *cfg){ - if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: prepare statement=%s", sdata->ttmpfile, s); - *stmt = mysql_stmt_init(&(sdata->mysql)); if(!*stmt){ syslog(LOG_PRIORITY, "%s: mysql_stmt_init() error", sdata->ttmpfile);