Send crashmessage just once per day.
[citadel.git] / citadel / msgbase.c
index 4d1881c6ba081e67968d2ca8f2d02d48506d4dbf..ddc12aafdba517bfa33030a5873582455138d836 100644 (file)
@@ -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;
 }