ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp
branchRCL_3
changeset 8 e1b6206813b4
parent 0 8466d47a6819
child 12 4ce476e64c59
equal deleted inserted replaced
4:e7aa27f58ae1 8:e1b6206813b4
   150     aFSMailBoxId,
   150     aFSMailBoxId,
   151     aFSOperationObserver,
   151     aFSOperationObserver,
   152     aFSRequestId),
   152     aFSRequestId),
   153     iSelection( NULL ),
   153     iSelection( NULL ),
   154     iGetMailInfo(aGetMailInfo),
   154     iGetMailInfo(aGetMailInfo),
   155     iFunctionId(aFunctionId)
   155     iFunctionId(aFunctionId),
       
   156     iRetryCount( 0 )
   156     {
   157     {
   157     FUNC_LOG;
   158     FUNC_LOG;
   158     iService = aService;
   159     iService = aService;
   159     }
   160     }
   160 
   161 
   231             if(!connected)
   232             if(!connected)
   232                 {
   233                 {
   233                 CompleteObserver( KErrCouldNotConnect );
   234                 CompleteObserver( KErrCouldNotConnect );
   234                 return;
   235                 return;
   235                 }
   236                 }
       
   237             iRetryCount = 0;
   236             DoFetchAttachmentL();
   238             DoFetchAttachmentL();
   237             break;
   239             break;
   238             }
   240             }
   239         case EStateFetching:         
   241         case EStateFetching:         
   240             {
   242             {
   241             delete iProgReport;
   243             delete iProgReport;
   242             iProgReport = NULL;
   244             iProgReport = NULL;
   243             
   245             
   244             TInt err = iStatus.Int();
   246             TInt err = iStatus.Int();
   245 
   247 
   246             if( err != KErrNone && iOperation )
   248             // If the server was busy, try again a few times.
       
   249             if ( err == KErrServerBusy && iRetryCount < 3 )
   247                 {
   250                 {
   248                 iFetchErrorProgress = iOperation->ProgressL().AllocL();
   251                 iRetryCount++;
       
   252                 DoFetchAttachmentL();
   249                 }
   253                 }
   250             
   254             else
   251             iState = EStateIdle;
   255                 {
   252             CompleteObserver( err );
   256                 if( err != KErrNone && iOperation )
       
   257                     {
       
   258                     iFetchErrorProgress = iOperation->ProgressL().AllocL();
       
   259                     }
       
   260                 
       
   261                 iState = EStateIdle;
       
   262                 CompleteObserver( err );
       
   263                 }
   253             break;
   264             break;
   254             }
   265             }
   255         default:
   266         default:
   256             break;
   267             break;
   257         }
   268         }