Commit 5c236f93 authored by David Faure's avatar David Faure
Browse files

Set an error code when we lost connection.

Otherwise the imap resource assumes we could log in, and stores the session
that just got deleted, leading to crashes further down the road.

CCBUG: 288268
parent de80117a
......@@ -497,6 +497,8 @@ void LoginJob::connectionLost()
//don't emit the result if the connection was lost before getting the tls result, as it can mean
//the TLS handshake failed and the socket was reconnected in normal mode
if (d->authState != LoginJobPrivate::StartTls) {
setError( ERR_COULD_NOT_CONNECT );
setErrorText( i18n("Connection to server lost.") );
emitResult();
}
......
......@@ -59,6 +59,10 @@ class KIMAP_EXPORT LoginJob : public Job
Anonymous
};
enum ErrorCode {
ERR_COULD_NOT_CONNECT = KJob::UserDefinedError + 23 // same as in kio
};
explicit LoginJob( Session *session );
virtual ~LoginJob();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment