From 5a307b0a88035de98ff16efc347994c82bdab8a9 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 17 Feb 2015 20:20:05 +0100 Subject: [PATCH] Send crashmessage just once per day. --- citadel/msgbase.c | 4 ++-- citadel/msgbase.h | 2 +- citadel/sysdep.c | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 135fe0e39..ddc12aafd 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -3050,7 +3050,7 @@ void flood_protect_quickie_message(const char *from, const char *subject, int nCriterions, const char **CritStr, - long *CritStrLen, + const long *CritStrLen, long ccid, long ioid, time_t NOW) @@ -3088,7 +3088,7 @@ void flood_protect_quickie_message(const char *from, eUpdate, ccid, ioid); - if (seenstamp < tsday) + if ((seenstamp > 0) && (seenstamp < tsday)) { FreeStrBuf(&guid); /* yes, we did. flood protection kicks in. */ diff --git a/citadel/msgbase.h b/citadel/msgbase.h index e4e2317b6..6d5f726ba 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -96,7 +96,7 @@ void flood_protect_quickie_message(const char *from, const char *subject, int nCriterions, const char **CritStr, - long *CritStrLen, + const long *CritStrLen, long ccid, long ioid, time_t NOW); diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 19e5eb5ce..787a93a3d 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -1100,7 +1100,8 @@ void checkcrash(void) if (nFireUpsNonRestart != nFireUps) { StrBuf *CrashMail; - + const char *msgs[1] = {"crash"}; + const long lens[1] = {sizeof("crash") - 1}; CrashMail = NewStrBuf(); syslog(LOG_ALERT, "Posting crash message\n"); StrBufPrintf(CrashMail, @@ -1117,7 +1118,11 @@ void checkcrash(void) " If you have already done this, the core dump is likely to be found at %score.%d\n" , ctdl_run_dir, ForkedPid); - CtdlAideMessage(ChrPtr(CrashMail), "Citadel server process terminated unexpectedly"); + CtdlAideFPMessage(ChrPtr(CrashMail), + "Citadel server process terminated unexpectedly", + 1, msgs, lens, + 0, 0, + time(NULL)); FreeStrBuf(&CrashMail); } } -- 2.30.2