localconnectivityservice/dun/atext/src/DunAtCmdPusher.cpp
branchRCL_3
changeset 15 27dcfaab8b5b
parent 13 2702348f1fe7
child 20 3dcb815346df
equal deleted inserted replaced
14:2553637c2525 15:27dcfaab8b5b
   272 TInt CDunAtCmdPusher::CheckAndRemoveOkString()
   272 TInt CDunAtCmdPusher::CheckAndRemoveOkString()
   273     {
   273     {
   274     FTRACE(FPrint( _L("CDunAtCmdPusher::CheckAndRemoveOkString()") ));
   274     FTRACE(FPrint( _L("CDunAtCmdPusher::CheckAndRemoveOkString()") ));
   275     TInt recvBufferLength = iRecvBuffer.Length();
   275     TInt recvBufferLength = iRecvBuffer.Length();
   276     TInt okBufferLength = iOkBuffer->Length();
   276     TInt okBufferLength = iOkBuffer->Length();
   277     if ( recvBufferLength <= okBufferLength )
   277     // Skip the removal if removing not possible, if removal results in zero
   278         {
   278     // length (plugin should have used KErrReplyTypeOk) or if string to be
   279         FTRACE(FPrint( _L("CDunAtCmdPusher::CheckAndRemoveOkString() (ERROR) complete") ));
   279     // removed is zero.
       
   280     // Note also that if plugin sends a final reply when quiet mode is on, DUN
       
   281     // can't remove the possibly existing result code as it is different from
       
   282     // iOkReply (zero length).
       
   283     if ( recvBufferLength<=okBufferLength || okBufferLength<=0 )
       
   284         {
       
   285         FTRACE(FPrint( _L("CDunAtCmdPusher::CheckAndRemoveOkString() (skip) complete") ));
   280         return KErrGeneral;
   286         return KErrGeneral;
   281         }
   287         }
   282     TInt lengthWithNoOk = recvBufferLength - okBufferLength;
   288     TInt lengthWithNoOk = recvBufferLength - okBufferLength;
   283     TPtr8 recvBufferDes( &iRecvBuffer[lengthWithNoOk], okBufferLength, okBufferLength );
   289     TPtr8 recvBufferDes( &iRecvBuffer[lengthWithNoOk], okBufferLength, okBufferLength );
   284     if ( recvBufferDes.Compare(*iOkBuffer) != 0 )
   290     if ( recvBufferDes.Compare(*iOkBuffer) != 0 )