[Kde-pim] Review Request: Refactoring handling IMAP responses during login phase in Akonadi

Oleg Girko ol+kde at infoserver.ru
Sun Feb 5 19:01:24 GMT 2012



> On Feb. 3, 2012, 5:07 p.m., Kevin Krammer wrote:
> > kimap/loginjob.cpp, line 272
> > <http://git.reviewboard.kde.org/r/103854/diff/1/?file=48560#file48560line272>
> >
> >     I am wondering whether this is not something that is useful in more places. My guess is that other jobs have to check response codes as well.
> >     Maybe as a function in JobPrivate?

As far as I understand from reading sources for other jobs, responses are already being handled relatively uniform way either by using KIMAP::Job::handleErrorReplies() method or even by not overriding KIMAP::Job::handleResponse() method at all. Most of the jobs just send a single command and expect "OK" response, so default behaviour is sufficient for them.

KIMAP::LoginJob is a special complex case because it implements a finite state machine which traverses through several different states in sequence by sending commands and handling their responses. Hence, default response handling is insufficient for KIMAP::LoginJob, so its overriden handleResponse() method uses more complex algorthm to handle all responses by itself.

Of course, some refactoring of other jobs could be beneficial for better correctness and readability, but IMHO those changes are logically independent, so they should be placed in separate commits instead of piling them up in a single large change.


- Oleg


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103854/#review10324
-----------------------------------------------------------


On Feb. 2, 2012, 9:49 p.m., Oleg Girko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103854/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2012, 9:49 p.m.)
> 
> 
> Review request for KDEPIM-Libraries.
> 
> 
> Description
> -------
> 
> Refactoring KIMAP::LoginJob::handleResponse() method in kimap/loginjob.cpp file to make its logic more readable, straightforward and correct.
> As a side effect, it fixes https://bugs.kde.org/show_bug.cgi?id=249992 by handling untagged CAPABILITY responses more correct and uniform way.
> 
> 
> This addresses bug 249992.
>     http://bugs.kde.org/show_bug.cgi?id=249992
> 
> 
> Diffs
> -----
> 
>   kimap/loginjob.cpp fad276d957e46fd00efa20a5f235d02a639ab2c4 
> 
> Diff: http://git.reviewboard.kde.org/r/103854/diff/diff
> 
> 
> Testing
> -------
> 
> Successfully tested with Dovecot IMAP server 2.0.17 using CRAM-MD5 and GSSAPI authentication with unencrypted and SSL connection.
> 
> 
> Thanks,
> 
> Oleg Girko
> 
>

_______________________________________________
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