realtimenetprots/sipfw/SIP/ConnectionMgr/src/TTCPMsgComplete.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name        : TTCPMsgComplete.cpp
       
    15 // Part of     : ConnectionMgr
       
    16 // Implementation
       
    17 // Version     : SIP/4.0
       
    18 //
       
    19 
       
    20 
       
    21 
       
    22 #include "TTCPMsgComplete.h"
       
    23 #include "MMsgAssemblerContext.h"
       
    24 #include "MSIPMsgAssemblerOwner.h"
       
    25 #include "SipAssert.h"
       
    26 
       
    27 // ----------------------------------------------------------------------------
       
    28 // TTCPMsgComplete::DataReceivedL
       
    29 // ----------------------------------------------------------------------------
       
    30 //
       
    31 void TTCPMsgComplete::DataReceivedL( TPtr8 aData, TUint&  aNextLength )
       
    32 	{
       
    33 	// panic if message == 0 in debug mode. leaves in release mode.
       
    34 	__SIP_ASSERT_LEAVE(iMsgAssembler.Message() != 0, KErrGeneral);
       
    35 	
       
    36 	iMsgAssembler.MsgOwner().MessageCompleteL ( iMsgAssembler.Message(), 
       
    37 											    KErrNone, 
       
    38 											    iMsgAssembler.IsSigComp() );
       
    39 	// ask msgAssembler to detach the message
       
    40 	iMsgAssembler.DetachMsg();
       
    41 	
       
    42 	// reset the state to msg init
       
    43 	iMsgAssembler.ChangeState(MMsgAssemblerContext::EMsgInit);
       
    44 	
       
    45 	if ( aData.Length() > 0)
       
    46 		{
       
    47 		// Enter to EMsgInit state, try to find next message header
       
    48 		iMsgAssembler.CurrentState().DataReceivedL(aData, aNextLength );
       
    49 		}
       
    50 	}