[Bug 77862] kio_imap processes hang when connection status changes

Maurel guy-kde at maurel.de
Fri Jul 30 17:34:06 BST 2010


https://bugs.kde.org/show_bug.cgi?id=77862





--- Comment #78 from Maurel <guy-kde maurel de>  2010-07-30 18:34:03 ---
As written at comment #42, the bug isn't abandoned. I whish to let you test my
solution for it, until the migration to akonadi is done.

Now, kio_imap process doesn't hang anymore on IP-Address change.

To solve it I propose to introduce the class KIpAddressInUse.
With this class, we can:
- save the actually used IP-address by the connection
- check if the saved IP-address is still available

kmail only need to:
- check the availibity of the IP-address each time
    _before_ using the socket to write to the IMAP-server and
    _before_ using the socket to read from the IMAP-server
If the socket is not available kmail:
- marks the error as ERR_CONNECTION_BROKEN and close the connection

Then kmail has to:
- check the state of the connection after each use of the socket
  and return from the actual method/function ie.:
    if (getState () == ISTATE_NO) return ;

The rest of the work is already present at release 4.4:
- SlaveBase::error
    sends a signal to the application.
- The application sends a DISCONNECT to the slave
    and cleans some data to be ready for the next connection.

As defined at imapaccountbase.h:533
    /** used to send a noop to the slave in regular intervals to keep it from
disonnecting */
    QTimer mNoopTimer;
and used at kmacctimap.cpp:63
    mNoopTimer.start( 60000 ); // // send a noop every minute
The timer sends a NOOP-command after this time and defines two periods:
One before the NOOP, one after.

Let us have a look to what appens when the IP-Address has changed.

If the user makes an action with network traffic, this leads to a
detection of the IP-Address and "killAllJobs" throws all the jobs and
clears the connection. The user must try again.

If the user action occurs after the NOOP, all is already clear.

The attachments are base on branches/KDE/4.4 files.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list