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

List:       kmail-devel
Subject:    Re: KMail blocks just before checking POP3 mailboxes
From:       Don Sanders <sanders () kde ! org>
Date:       2004-06-01 4:35:12
Message-ID: 200406011435.12234.sanders () kde ! org
[Download RAW message or body]

On Tuesday 01 June 2004 02:16, Martijn Klingens wrote:
> On Monday 31 May 2004 17:57, Ingo Klöcker wrote:
> > When I last looked at the code (not too long ago) then that's
> > exactly what should already happen. But maybe it only works this
> > way for people who actually leave messages on the server.
>
> Probably. Take a look at this beauty:
>
> -----
> martijn:~/src/kde-head/kdepim/kmail> cvs log -r1.130
> kmacctexppop.cpp revision 1.130
> date: 2003/03/11 13:14:09;  author: sanders;  state: Exp;  lines:
> +5 -2 An attempt to prevent duplicate downloading of mails that are
> left on the server. Chance of success slim, but it's been working
> for 3 days here.

Amazingly it did actually seem to work.

> martijn:~/src/kde-head/kdepim/kmail> cvs di -r1.129 -r1.130
> kmacctexppop.cpp Index: kmacctexppop.cpp
> ===================================================================
> RCS file: /home/kde/kdepim/kmail/kmacctexppop.cpp,v
> retrieving revision 1.129
> retrieving revision 1.130
> diff -u -p -r1.129 -r1.130
> --- kmacctexppop.cpp    9 Mar 2003 23:34:02 -0000       1.129
> +++ kmacctexppop.cpp    11 Mar 2003 13:14:09 -0000      1.130
> @@ -405,6 +405,9 @@ void KMAcctExpPop::slotJobFinished() {
>        "The feature to leave the mails on the server will therefore
> not " "work properly."));
>      }
> +    // An attempt to work around buggy pop servers, these seem to
> be popular. +    if (uidsOfNextSeenMsgs.isEmpty())
> +       uidsOfNextSeenMsgs = uidsOfSeenMsgs;
>
>      //check if filter on server
>      if (mFilterOnServer == true) {
> -----
>
> I added kdDebugs around the code:
>
> -----
>     kdDebug() << "***************** " << k_funcinfo <<
> "uidsOfNextSeenMsgs: " << uidsOfNextSeenMsgs.count() << endl;
>     // An attempt to work around buggy pop servers, these seem to
> be popular. if (uidsOfNextSeenMsgs.isEmpty())
>       uidsOfNextSeenMsgs = mUidsOfSeenMsgs;
>
>     kdDebug() << "***************** " << k_funcinfo <<
> "uidsOfNextSeenMsgs: " << uidsOfNextSeenMsgs.count() << endl;
> -----
>
> And the output:
>
> -----
> kmail: ****** [void KMAcctExpPop::slotJobFinished()]
> uidsOfNextSeenMsgs: 0 kmail: ****** [void
> KMAcctExpPop::slotJobFinished()] uidsOfNextSeenMsgs: 80645 -----
>
> OOPS :)
>
> This commit makes the UID list grow ad infinitum without ever
> returning to normal.
>
> After looking at the code I have the impression that disabling this
> check will indeed restore the behaviour I proposed, but I'm pretty
> sure Don didn't commit this just for the fun of it.
>
> What exactly is broken that it requires this hack, and what's a
> solution that doesn't have this massive side effect?

Some versions of some pop servers sometimes erroneously return an 
empty list of uids (a bug in these pop servers that is totally 
non-reproducible). This causes all mail to be downloaded again 
(causing duplicate downloads) for people who leave mail on the 
server.

Maybe it would be ok to only apply the
 +    if (uidsOfNextSeenMsgs.isEmpty())
 +       uidsOfNextSeenMsgs = uidsOfSeenMsgs;
check when the user has _not_ selected the option to leave mail on the 
server?

BTW rather than using kdDebugs to track down time consuming code it is 
sometimes easier just to run the app in gdb (run --nofork) and when 
it blocks Ctrl-C it and get a backtrace.

Don.
_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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