locationrequestmgmt/networkrequesthandler/src/ngmessageswitch.cpp
branchRCL_3
changeset 65 a796fdeeb33c
parent 55 c92d4f3c47c5
equal deleted inserted replaced
58:87622fad6b51 65:a796fdeeb33c
   133 	}
   133 	}
   134 
   134 
   135 void CNGMessageSendBuffer::BufferData(TLbsNetInternalMsgBase* aData)
   135 void CNGMessageSendBuffer::BufferData(TLbsNetInternalMsgBase* aData)
   136 	{	
   136 	{	
   137 	// Add the data to the buffer
   137 	// Add the data to the buffer
   138 	TInt err = iBuffer.Append(aData);
   138 	iBuffer.Append(aData);
   139 	if( err != KErrNone )
       
   140 		{
       
   141 		LBSLOG_ERR2(ELogP3, "CNGMessageSendBuffer::BufferData Append failed: %d", err);
       
   142 		delete aData;
       
   143 		}
       
   144 	}
   139 	}
   145 
   140 
   146 void CNGMessageSendBuffer::BufferEmergencyData(TLbsNetInternalMsgBase* aData)
   141 void CNGMessageSendBuffer::BufferEmergencyData(TLbsNetInternalMsgBase* aData)
   147 	{	
   142 	{	
   148 	// Add the data to the emergency buffer
   143 	// Add the data to the emergency buffer
   513 					
   508 					
   514 					// OOM  - do nothing here - just ignore the error which results in the REF pos 
   509 					// OOM  - do nothing here - just ignore the error which results in the REF pos 
   515 					// not being saved. Note we do enure that the mobiles position
   510 					// not being saved. Note we do enure that the mobiles position
   516 					// does get sent out to the network - its juts means that the callback
   511 					// does get sent out to the network - its juts means that the callback
   517 					// that delivers the REF pos to the privacy system does not happen!
   512 					// that delivers the REF pos to the privacy system does not happen!
   518 					TInt err = iRefPosBuffer.Append(item);
   513 					iRefPosBuffer.Append(item);
   519 					if( KErrNone != err )
   514 					
   520 						{
       
   521 						LBSLOG_ERR(ELogP3, "CNGMessageSwitch::ProcessNetChannelMessage: iRefPosBuffer.Append Failed!!");
       
   522 						}
       
   523 					for (TInt i = 0; i < count; i++)
   515 					for (TInt i = 0; i < count; i++)
   524 						{
   516 						{
   525 						iObservers[i]->OnNetLocReferenceUpdate(msg->SessionId(), positionInfo);
   517 						iObservers[i]->OnNetLocReferenceUpdate(msg->SessionId(), positionInfo);
   526 						}
   518 						}
   527 					}
   519 					}
   539 					else
   531 					else
   540 						{
   532 						{
   541 						item->iSessionId = msg->SessionId();
   533 						item->iSessionId = msg->SessionId();
   542 					
   534 					
   543 						Mem::Copy(&item->iPosInfo, &positionInfo, positionInfo.PositionClassSize());
   535 						Mem::Copy(&item->iPosInfo, &positionInfo, positionInfo.PositionClassSize());
   544 						TInt err = iFNPPosBuffer.Append(item); // here, ownership passes to pointer array!
   536 						iFNPPosBuffer.Append(item); // here, ownership passes to pointer array!
   545 						if( KErrNone != err )
       
   546 							{
       
   547 							delete item;
       
   548 							LBSLOG_ERR(ELogP3, "CNGMessageSwitch::ProcessNetChannelMessage: iFNPPosBuffer.Append Failed!!");
       
   549 							}
       
   550 						}
   537 						}
   551 					for (TInt i = 0; i < count; i++)
   538 					for (TInt i = 0; i < count; i++)
   552 						{
   539 						{
   553 						iObservers[i]->OnNetLocFinalUpdate(msg->SessionId(), positionInfo);
   540 						iObservers[i]->OnNetLocFinalUpdate(msg->SessionId(), positionInfo);
   554 						}
   541 						}