[Kde-pim] yaps for 77862, kio_imap process doesn't hang anymore

Guy Maurel guy-kde at maurel.de
Sun Jul 11 14:43:51 BST 2010


This is "yaps for 77862" with the description of 
   "Yet Another Proposal of a Solution" for bug 77862.
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.  

Ready!
-- 
guy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: yaps-77862-kdepim.diff
Type: text/x-patch
Size: 338 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100711/df774a36/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yaps-77862-kdepimlibs.diff
Type: text/x-patch
Size: 24401 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100711/df774a36/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kipaddressinuse.h
Type: text/x-chdr
Size: 2139 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100711/df774a36/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kipaddressinuse.cpp
Type: text/x-c++src
Size: 1928 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100711/df774a36/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kipaddressinusetest.cpp
Type: text/x-c++src
Size: 1596 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100711/df774a36/attachment-0001.cpp>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list