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