webservices/wshttpchanneltransportplugin/src/senhttpsyncrequester.cpp
branchRCL_3
changeset 11 6abf3d6055cd
parent 1 272b002df977
equal deleted inserted replaced
7:7bc6ab9b5bcd 11:6abf3d6055cd
    88 
    88 
    89 CSenHttpSyncRequester::~CSenHttpSyncRequester()
    89 CSenHttpSyncRequester::~CSenHttpSyncRequester()
    90     {
    90     {
    91     delete iContentType;
    91     delete iContentType;
    92     delete iContent;
    92     delete iContent;
    93     if (!isStopped)
    93     if (!isStopped && iSchedulerWait.IsStarted())
    94         {
    94         {
    95         iSchedulerWait.AsyncStop();
    95         iSchedulerWait.AsyncStop();
    96         }
    96         }
    97     }
    97     }
    98 void CSenHttpSyncRequester::DoCancel()
    98 void CSenHttpSyncRequester::DoCancel()
   102 void CSenHttpSyncRequester::RunL()
   102 void CSenHttpSyncRequester::RunL()
   103     {
   103     {
   104     if (!isStopped)
   104     if (!isStopped)
   105         {
   105         {
   106         iStatusCode = KErrTimedOut;
   106         iStatusCode = KErrTimedOut;
   107         iSchedulerWait.AsyncStop();
   107 	    if (iSchedulerWait.IsStarted())
       
   108 	        {
       
   109 	        iSchedulerWait.AsyncStop();
       
   110 	        }
   108         }
   111         }
   109     isStopped = ETrue;
   112     isStopped = ETrue;
   110     }
   113     }
   111 TInt CSenHttpSyncRequester::RunError(TInt aError)
   114 TInt CSenHttpSyncRequester::RunError(TInt aError)
   112     {
   115     {
   113     if (!isStopped)
   116     if (!isStopped)
   114         {
   117         {
   115         iStatusCode = aError;
   118     	iStatusCode = aError;
   116         iSchedulerWait.AsyncStop();
   119 	    if (iSchedulerWait.IsStarted())
       
   120 	        {
       
   121 	        iSchedulerWait.AsyncStop();
       
   122 	        }
   117         }
   123         }
   118     isStopped = ETrue;
   124     isStopped = ETrue;
   119     return aError;
   125     return aError;
   120     }
   126     }
   121 
   127 
   180 
   186 
   181 void CSenHttpSyncRequester::ResponseReceivedL( TInt /*aId*/, const TAny* aContentType, HBufC8* apContent, CSenHttpTransportProperties* /*aHttpProperties*/ )
   187 void CSenHttpSyncRequester::ResponseReceivedL( TInt /*aId*/, const TAny* aContentType, HBufC8* apContent, CSenHttpTransportProperties* /*aHttpProperties*/ )
   182     {
   188     {
   183     iContent = apContent; // transfers ownership of content into _this_ class
   189     iContent = apContent; // transfers ownership of content into _this_ class
   184     iContentType = ((HBufC8*)aContentType)->AllocL();
   190     iContentType = ((HBufC8*)aContentType)->AllocL();
   185     if (!isStopped)
   191     if (!isStopped && iSchedulerWait.IsStarted())
   186         {
   192         {
   187         iSchedulerWait.AsyncStop();
   193         iSchedulerWait.AsyncStop();
   188         }
   194         }
   189     isStopped = ETrue;
   195     isStopped = ETrue;
   190     }
   196     }