[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: compact on exit
From:       Don Sanders <sanders () kde ! org>
Date:       2000-08-31 0:09:06
[Download RAW message or body]

On Thu, 31 Aug 2000, Daniel Naber wrote:
> Hi,
>
> if compact on exit is problematic in the case of a crash, then why do we
> do it? I mean we have signal (=crash) handlers, which call
> kernel->dumpDeadLetters(), which then calls cleanup(), which does the
> compacting. Couldn't we just add a parameter so compacting is only
> attempted when there is no crash?

Good point!

In fact maybe we shouldn't close the inbox, outbox and sent folders either. 
Since you had a problem with the inbox being corrupted when killing X with 
Ctrl-Alt-Backspace.

The only other things we do in cleanup are empty the trash when empty trash 
on exit is turned on as an option. Forget that, it's risky too if data 
structures have been corrupted. 'rm -rf' the attachment directory, too risky 
as well let's not do that. And a kapp->config()->sync(), hmm, that one is a 
closer call.

I say we completely remove the cleanup call form dumpDeadLetters.

diff -u -b -r1.20 kmkernel.cpp
--- kmkernel.cpp        2000/08/06 17:01:55     1.20
+++ kmkernel.cpp        2000/08/31 00:03:26
@@ -498,7 +498,6 @@
     if (win->inherits("KMComposeWin")) ((KMComposeWin*)win)->deadLetter();
 //    delete win; // WABA: Don't delete, we might crash in there!
   }
-  cleanup();
 }
 
I was always toying with the following patch to prevent prevent folder 
corruption on compaction. I'm not sure if it's a good idea or not.

diff -u -b -r1.112 kmfolder.cpp
--- kmfolder.cpp        2000/08/30 13:32:26     1.112
+++ kmfolder.cpp        2000/08/30 23:53:51
@@ -1191,6 +1191,13 @@
     }
 
     msg = getMsg(0);
+    if (msg->headerField("X-Status") == "%") {
+       KMessageBox::sorry( 0L,
+                           i18n("An unknown internal error occurred.  Please 
report to kmail@kde.org") );
+       rc = 2;
+       break;
+    }
+
     if(msg)
       rc = tempFolder->moveMsg(msg);
     if (rc)                                                                  
         
BFN,
Don.
                         

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic