X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=ddc12aafdba517bfa33030a5873582455138d836;hb=5a307b0a88035de98ff16efc347994c82bdab8a9;hp=4d1881c6ba081e67968d2ca8f2d02d48506d4dbf;hpb=10a238f3ecfe0a3a197c267442098770c66d364d;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 4d1881c6b..ddc12aafd 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -2870,9 +2870,9 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ /* Bump this user's messages posted counter. */ MSGM_syslog(LOG_DEBUG, "Updating user\n"); - CtdlGetUserLock(&CCC->user, CCC->curr_user); + CtdlLockGetCurrentUser(); CCC->user.posted = CCC->user.posted + 1; - CtdlPutUserLock(&CCC->user); + CtdlPutCurrentUserLock(); /* Decide where bounces need to be delivered */ if ((recps != NULL) && (recps->bounce_to == NULL)) @@ -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. */ @@ -3264,6 +3264,11 @@ eReadState CtdlReadMessageBodyAsync(AsyncIO *IO) IO->SendBuf.fd); fd = fopen(fn, "a+"); + if (fd == NULL) { + syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno)); + cit_backtrace(); + exit(1); + } #endif ReadMsg = IO->ReadMsg; @@ -3345,7 +3350,7 @@ eReadState CtdlReadMessageBodyAsync(AsyncIO *IO) if (MsgFinished) return eReadSuccess; else - return eAbort; + return eReadFail; }