voipplugins/accountcreationplugin/engine/src/acphttphandler.cpp
branchRCL_3
changeset 33 2989b291cac7
parent 29 755430a7d64b
equal deleted inserted replaced
31:5886d40bb3de 33:2989b291cac7
    38 // ---------------------------------------------------------------------------
    38 // ---------------------------------------------------------------------------
    39 // CAcpHttpHandler::CAcpHttpHandler
    39 // CAcpHttpHandler::CAcpHttpHandler
    40 // ---------------------------------------------------------------------------
    40 // ---------------------------------------------------------------------------
    41 //
    41 //
    42 CAcpHttpHandler::CAcpHttpHandler( MAcpHttpHandlerObserver& aObserver )
    42 CAcpHttpHandler::CAcpHttpHandler( MAcpHttpHandlerObserver& aObserver )
    43     : CActive( CActive::EPriorityStandard ), iObserver( aObserver ), iCancelRequest( EFalse )
    43     : CActive( CActive::EPriorityStandard ), iObserver( aObserver )
    44     {
    44     {
    45     CActiveScheduler::Add( this );
    45     CActiveScheduler::Add( this );
    46     }
    46     }
    47 
    47 
    48 // ---------------------------------------------------------------------------
    48 // ---------------------------------------------------------------------------
   309     ACPLOG( "CAcpHttpHandler::CancelTransaction begin" );
   309     ACPLOG( "CAcpHttpHandler::CancelTransaction begin" );
   310     
   310     
   311     if ( !iTransactionRunning )
   311     if ( !iTransactionRunning )
   312         {
   312         {
   313         ACPLOG( "CAcpHttpHandler::CancelTransaction end (not running)" );
   313         ACPLOG( "CAcpHttpHandler::CancelTransaction end (not running)" );
   314         iCancelRequest = ETrue;
       
   315         return;
   314         return;
   316         }
   315         }
   317     
   316     
   318     iTransaction.Close();
   317     iTransaction.Close();
   319     ACPLOG( " - transaction closed" );
   318     ACPLOG( " - transaction closed" );
   494                 
   493                 
   495                 // HTTP error occurred, it's safer to restart the connection.
   494                 // HTTP error occurred, it's safer to restart the connection.
   496                 iConnectionOpen = EFalse;
   495                 iConnectionOpen = EFalse;
   497                 iSession.Close();
   496                 iSession.Close();
   498                 iConnection.Close();
   497                 iConnection.Close();
   499                 iSocketServer.Close();
   498                 
   500                 // Reopen session.
   499                 // Reopen session.
   501                 iSession.OpenL();
   500                 iSession.OpenL();
   502                 }
   501                 }
   503             }
   502             }
   504             break;
   503             break;
   520     
   519     
   521     // HTTP error occurred, it's safer to restart the connection.
   520     // HTTP error occurred, it's safer to restart the connection.
   522     iConnectionOpen = EFalse;
   521     iConnectionOpen = EFalse;
   523     iSession.Close();
   522     iSession.Close();
   524     iConnection.Close();
   523     iConnection.Close();
   525     iSocketServer.Close();
   524     
   526     // Reopen session.
   525     // Reopen session.
   527     TRAP_IGNORE( iSession.OpenL() );
   526     TRAP_IGNORE( iSession.OpenL() );
   528     
   527     
   529     return KErrNone;
   528     return KErrNone;
   530     }
   529     }
   558             iNetId = connInfo.iNetId;
   557             iNetId = connInfo.iNetId;
   559             
   558             
   560             iConnectionOpen = ETrue;
   559             iConnectionOpen = ETrue;
   561             }
   560             }
   562         
   561         
   563         // If the cancel button is pressed by the end user during the period of connection-opening,
   562         // Submit the first transaction. Further transactions are submitted
   564         // transaction need not to be submitted. Otherwise, need to be submitted.
   563         // in GetDataL.
   565         if ( iCancelRequest )
   564         SubmitTransactionL();
   566             {
       
   567             iCancelRequest = EFalse;     
       
   568             }
       
   569         else
       
   570             {
       
   571             // Submit the first transaction. Further transactions are submitted
       
   572             // in GetDataL.
       
   573             SubmitTransactionL();
       
   574             }
       
   575         }
   565         }
   576     else
   566     else
   577         {
   567         {
   578         // Error occurred, notify observer.
   568         // Error occurred, notify observer.
   579         iObserver.NotifyHttpError( iStatus.Int() );
   569         iObserver.NotifyHttpError( iStatus.Int() );