telephonyprotocols/rawipnif/src/Receiver.cpp
branchRCL_3
changeset 74 9200f38b1324
parent 66 07a122eea281
child 82 042fd2753b8f
equal deleted inserted replaced
70:4814c5a49428 74:9200f38b1324
   122 		return;
   122 		return;
   123 		}
   123 		}
   124 	else
   124 	else
   125 	    {
   125 	    {
   126         _LOG_L1C1(_L8("CReceiver: Data Packet Received"));
   126         _LOG_L1C1(_L8("CReceiver: Data Packet Received"));
   127     
   127 
   128         iRMBufPacket.CreateL(iData);
   128         // Trap the leave to prevent the flow from being stopped if
   129         
   129         // the MBuf pool is temporarily exhausted.    
   130         // Immediately execute new read request.
   130 		TRAPD(err,iRMBufPacket.CreateL(iData));
       
   131 
       
   132         // Immediately execute new read request, regardless of whether MBufs are
       
   133         // exhausted or not.
   131         (iObserver.Bca())->Read(iStatus, iData);
   134         (iObserver.Bca())->Read(iStatus, iData);
   132     
   135     
   133         SetActive();
   136         SetActive();
   134         
   137         
   135         iRMBufPacket.Pack();
   138         if (err == KErrNone)
       
   139             {
       
   140         	iRMBufPacket.Pack();
   136     
   141     
   137 #ifdef RAWIP_HEADER_APPENDED_TO_PACKETS
   142 #ifdef RAWIP_HEADER_APPENDED_TO_PACKETS
   138         TUint16 protocolCode = iObserver.RemoveHeader(iRMBufPacket);
   143         	TUint16 protocolCode = iObserver.RemoveHeader(iRMBufPacket);
   139 #else
   144 #else
   140         TUint16 protocolCode = 0;
   145         	TUint16 protocolCode = 0;
   141 #endif // RAWIP_HEADER_APPENDED_TO_PACKETS
   146 #endif // RAWIP_HEADER_APPENDED_TO_PACKETS
   142     
   147     
   143         // Process the packet
   148         	// Process the packet
   144         iObserver.GetObserver().Process(iRMBufPacket, protocolCode);
   149         	iObserver.GetObserver().Process(iRMBufPacket, protocolCode);
   145         iRMBufPacket.Free();
   150         	iRMBufPacket.Free();
       
   151 			}
       
   152 		else
       
   153 			{
       
   154 			// If MBuff Allocation failed then dont process the packet, rely on layers above for recovery
       
   155 			_LOG_L2C2(_L8("CReceiver::RunL MBuff Allocation Failure [err=%d]"), err);
       
   156 			}
   146 	    }
   157 	    }
   147 	}
   158 	}
   148 
   159 
   149 TInt CReceiver::RunError(TInt aError)
   160 TInt CReceiver::RunError(TInt aError)
   150     {
   161     {