diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp --- a/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -152,7 +152,8 @@ aFSRequestId), iSelection( NULL ), iGetMailInfo(aGetMailInfo), - iFunctionId(aFunctionId) + iFunctionId(aFunctionId), + iRetryCount( 0 ) { FUNC_LOG; iService = aService; @@ -233,6 +234,7 @@ CompleteObserver( KErrCouldNotConnect ); return; } + iRetryCount = 0; DoFetchAttachmentL(); break; } @@ -243,13 +245,22 @@ TInt err = iStatus.Int(); - if( err != KErrNone && iOperation ) + // If the server was busy, try again a few times. + if ( err == KErrServerBusy && iRetryCount < 3 ) { - iFetchErrorProgress = iOperation->ProgressL().AllocL(); + iRetryCount++; + DoFetchAttachmentL(); } - - iState = EStateIdle; - CompleteObserver( err ); + else + { + if( err != KErrNone && iOperation ) + { + iFetchErrorProgress = iOperation->ProgressL().AllocL(); + } + + iState = EStateIdle; + CompleteObserver( err ); + } break; } default: