TVerdict RTestStepResolverUtils::DoTestStepL()
	{
	INFO_PRINTF1(_L("Tests the video resolver utility "));
	_LIT8(KText, "<s>");
	TBufC8<50> data(KText);
	TPtr8 ptrData = data.Des();
	
	CCodecApiOpaqueData* codecApiOpaqueData = CCodecApiOpaqueData::NewLC(ptrData);
	const TDesC8 inputData = codecApiOpaqueData->InputDataType();
	if (inputData.CompareF(KNullDesC8) != 0)
		{
		INFO_PRINTF1(_L("Incorrect manufacturer"));		
		CleanupStack::PopAndDestroy(codecApiOpaqueData);
		return EFail;
		}
		
	const TDesC8 outputData = codecApiOpaqueData->OutputDataType();
	if (outputData.CompareF(KNullDesC8) != 0)
		{
		INFO_PRINTF1(_L("Incorrect manufacturer"));		
		CleanupStack::PopAndDestroy(codecApiOpaqueData);
		return EFail;
		}	
	
	CleanupStack::PopAndDestroy(codecApiOpaqueData);
	return EPass;
	}
// ---------------------------------------------------------
// CCookieTimer::SettingAttribute
// ---------------------------------------------------------
//
void CCookieManagerServer::SettingAttribute(TDesC8& attrName, TDesC8& attrData,TUint32& aGroupId
        , RArray<TUint32>& aSharedAppUidArray, TBool& aCookieSharableFlag  )
    {
    CLOG( ( EServer, 0, _L( "-> CCookieManagerServer::SettingAttribute" ) ) );
    TBuf8<100> groupname(KNullDesC8);
    TBuf8<100> bufGroupId(KNullDesC8);
    TBuf8<100> bufSharedAppUidName(KNullDesC8);
    TUint32 sharedAppUid = 0;
    if ( ! attrName.CompareF(KGroupName))
         {
          groupname.Copy(attrData);
         } else if ( ! attrName.CompareF(KGroupId)) 
              {
              bufGroupId.Copy(attrData);
              TInt err = ChangeToDecimal(bufGroupId, aGroupId);
              
              }else if ( ! attrName.CompareF(KUid3))
                 {
                 bufSharedAppUidName.Copy(attrData);
                 TInt err = ChangeToDecimal(bufSharedAppUidName, sharedAppUid);
                 if (err == KErrNone)
                     aSharedAppUidArray.AppendL(sharedAppUid);
                 
                 } else if (! attrName.CompareF(KCookieSharable))
                     {
                      if ( !attrData.CompareF(KOff) )
                          aCookieSharableFlag = EFalse;
                      else
                          aCookieSharableFlag = ETrue;
                     }
    CLOG( ( EServer, 0, _L( "<- CCookieManagerServer::SettingAttribute" ) ) );
    }
Example #3
0
/**
	Checks whether ParamSegment contains valid characters in 
	Parameter name and Parameter value as specified in RFC 3261.
							
	@param		aName	The descriptor for parameter name to be checked as per RFC 3261.
	@param		aValue	The descriptor for value to be checked as per RFC 3261.
	@return		A boolean value of ETrue if uri contains valid parameters and values,
				EFalse if it does not.
*/
TBool TValidatorSip::IsValidParamSegment(const TDesC8& aName, const TDesC8& aValue) const
	{
	if (!aName.Length() || !IsValidParam(aName) ) 
		{
		return EFalse;	
		}
	
	/**************************************************************************************************************
	* As per RFC 3261 if the uri-parameter contains name as Tranport or User or Method then its Value must be     *
	* the characters as specified in Token. else if the name is Ttl then its value must lie in between 0 - 255.   *
	* else if the name is Maddr then its value must be a host, else if the name is lr then it must not conatin    *
	* any value, else it must be a other-parameter whose value must conatin the characters specified in paramchar.*
	* As per INC 115503 and due to IOP issue Validation of lr paramater is not performed.						  *
	***************************************************************************************************************/
	if ( ( (aName.CompareF(KTransport()) == 0 || aName.CompareF(KUser()) == 0 || aName.CompareF(KMethod()) == 0 ) 	
	   	   	  && !IsValidParamToken(aValue) )
		|| ( aName.CompareF(KTtl()) == 0 && !IsValidParamTtl(aValue) )
		|| ( aName.CompareF(KMaddr()) == 0  && !IsValidParamMaddr(aValue) )
		|| ( aName.CompareF(KTransport()) != 0 && aName.CompareF(KUser()) != 0 && aName.CompareF(KMethod()) != 0 && aName.CompareF(KTtl()) != 0 
			&& aName.CompareF(KMaddr()) != 0 && aName.CompareF(KLr()) != 0 && !IsValidParam(aValue))
		)
		{
		return EFalse;	
		}

	return ETrue;
	}
// -----------------------------------------------------------------------------
//  CUpnpHttpServerTransactionHandler::NewTransactionL
//
// -----------------------------------------------------------------------------
//
void CUpnpHttpServerTransactionHandler::NewTransactionL( 
    const TDesC8& aMethod, const TDesC8& aUri, 
    const TInetAddr& aSender, CUpnpHttpServerTransaction*& aResultTrans )
    {
    _LIT8( KGet, "GET" );
    _LIT8( KHead, "HEAD" );
    if ( (aMethod.CompareF(KGet)==0) || (aMethod.CompareF(KHead)==0) )
        {
        aResultTrans = CUpnpHttpServerTransactionDescription::NewL( *this, aSender, aUri );
        }
    else
        {
        User::Leave( KErrGeneral );//bad request
        }
    }
// ---------------------------------------------------------------------------
// CSdpMediaField::RemoveFormatL
// ---------------------------------------------------------------------------
//
EXPORT_C void CSdpMediaField::RemoveFormatL(const TDesC8& aFormat)
{
    if ( !iFormatList || iFormatList->Des().Length() == 0 )
    {
        User::Leave( KErrSdpCodecMediaField );
    }
    TLex8 lexer( *iFormatList );
    TBool tokenRemoved( EFalse );
    while ( !tokenRemoved && !lexer.Eos() )
    {
        lexer.SkipSpaceAndMark();
        lexer.SkipCharacters();
        if ( lexer.TokenLength() > 0 )
        {
            if ( aFormat.CompareF(lexer.MarkedToken()) == 0)
            {
                RArray<TInt> removedObjs;
                CleanupClosePushL( removedObjs );
                for ( TInt i( 0 ); i < iFmtAttrFields->Count(); i++ )
                {
                    if (aFormat.CompareF((*iFmtAttrFields)[i]->Format()) == 0)
                    {
                        User::LeaveIfError( removedObjs.Append(i) );
                    }
                }
                // Remove all format attributes of type format
                TInt removedCount( 0 );
                while ( removedObjs.Count() > 0 )
                {
                    CSdpFmtAttributeField* obj =
                        (*iFmtAttrFields)[removedObjs[0] - removedCount];
                    delete obj;
                    obj = 0;
                    iFmtAttrFields->Remove( removedObjs[0] - removedCount);
                    removedObjs.Remove(0);
                    removedCount++;
                }
                CleanupStack::PopAndDestroy();  // removedObjs

                // Remove format from format list
                iFormatList->Des().Delete( lexer.MarkedOffset(),
                                           lexer.Offset() - lexer.MarkedOffset());
                iFormatList->Des().TrimAll();
                tokenRemoved = ETrue;
            }
        }
    }
}
TBool CHttpClientTestParams::CheckVariantValue(const THttpHeaderValueVariant& aVariant, const TDesC8& aValueToMatch)
    {
    TBool ret = EFalse;
    switch(aVariant.Type())
        {
        case THttpHeaderValueVariant::EIntType:
            {
            _LIT8(KIntType, "%d");
            TBuf8<16>  buf;
            buf.Format(KIntType(), aVariant.Int());
            ret = (buf.CompareF(aValueToMatch) == 0);                    
            }
        break;
        
        case THttpHeaderValueVariant::EStrType:
            {
            ret = (aVariant.Str().CompareF(aValueToMatch) == 0);
            }
        break;
        
        case THttpHeaderValueVariant::EDateTimeType:
            {
            TInternetDate internetDate(aVariant.DateTime());
            HBufC8* dateTimeStr = internetDate.InternetDateTimeL(TInternetDate::ERfc1123Format);
            ret = aValueToMatch.CompareF(*dateTimeStr) == 0;
            delete dateTimeStr;
            }
        break;
        
        default:
        User::Invariant();
        }    
    return ret;
    }
Example #7
0
/**
	@internalComponent

	Returns the type of the URIs scheme
	
	@param			aScheme	The descriptor with the scheme.
	@return			The scheme type
 */
TUriSchemeType SchemeType(const TDesC8& aScheme)
	{
	// Compares the scheme with both sip and sips
	if (aScheme.CompareF(KSipScheme8()) == 0 || aScheme.CompareF(KSipsScheme8()) == 0)
		{
		// there's a match so this is a sip scheme
		return ESchemeTypeSip;
		}
	//Compares the scheme with tel 
	else if (aScheme.CompareF(KTelScheme8()) == 0) 
		{
		return ESchemeTypeTel;
		} 

	return ESchemeTypeUnknown;
	}
Example #8
0
/**
	Checks whether any duplicate parameter names exist in the 
	whole path of the tel-uri, and also checks whether the both ISDN and EXTN 
	parameters exist in tel-uri.
							
	@param		aParamName	The descriptor to be checked.
	@param		aParamList	the path part of uri, which conatians all parameters and values.
	@return		A boolean value of ETrue if uri contains duplicate parameters or 
				both isdn and extn parameters exist, EFalse if it does not.
 */
TBool TValidatorTel::IsDuplicated(const TDesC8& aParamName, const TDelimitedParserBase8 aParamList) const
	{
	// roll back to the start of the lhs segment parser
	while(aParamList.Dec() != KErrNotFound) 
		{
		//do nothing
		}
	aParamList.Inc(); //To exclude phone number from the list.
	
	TPtrC8 name;
	TPtrC8 value;
	TPtrC8 segment;
	TInt count = 0;
	while( aParamList.GetNext(segment) == KErrNone )
		{
		GetNameValuePair(segment, name, value);
		if (aParamName.CompareF(name) == 0)
			{
			count++;	
			}
		if (count > 1)
			{
			// The parameter name appears more than once in the paramter list
			return ETrue;
			}
		if( ( KIsdnSubAddress().CompareF(aParamName) == 0 && KExtension().CompareF(name) == 0 ) || 
			( KExtension().CompareF(aParamName) == 0 && KIsdnSubAddress().CompareF(name) == 0 ) )
			{
			//Both ISDN and EXTN should not exist in Uri
			return ETrue;	
			}
		}

	return EFalse;	
	}
// -----------------------------------------------------------------------------
//  CUpnpHttpServerTransactionHandler::MatchType
//
// -----------------------------------------------------------------------------
//
CUpnpHttpServerTransactionHandler::TDescriptionType 
              CUpnpHttpServerTransactionHandler::MatchType( const TDesC8& aUri )
    {
    if ( aUri.CompareF( iDevice.DescriptionUrl() ) == 0 )
        {
        return EDevice;
        }

    //1st check if url is service url
    RPointerArray<CUpnpService> servList =
                 iDevice.ServiceList();
    TInt count = servList.Count();
    for( TInt index = 0; index < count; index++ )
        {
        if( servList[ index ]->ServiceDescriptionUrl().CompareF( aUri ) == 0 )
            {
            return EService;
            }
        }
    //next check icon list
    RPointerArray<CUpnpIcon> iconList =
                 iDevice.Icons();
    count = iconList.Count();
    for( TInt index2 = 0; index2 < count; index2++ )
        {
        if( iconList[ index2 ]->Url().CompareF( aUri ) == 0 )
            {
            return EIcon;
            }
        }
    return ENotFound;
    }
// ---------------------------------------------------------------------------
// CWmDrmDlaUiNotifierImpl::InitializeL
// ---------------------------------------------------------------------------
//
void CWmDrmDlaUiNotifierImpl::InitializeL( 
    TDesC8& aOpaqueData )
    {
    TInt err( KErrNotFound );
    
    LOGFNR( "CWmDrmDlaUiNotifierImpl::InitializeL", err );
    LOGHEX( aOpaqueData.Ptr(), aOpaqueData.Length() );
        
    delete iUiPlugin;
    iUiPlugin = NULL;
    RImplInfoPtrArray implArray;
    CleanupStack::PushL( TCleanupItem( DoResetDestroyAndClose, &implArray ) );
    REComSession::ListImplementationsL( KWmDrmDlaUiPluginIfUid, implArray );
    
    for ( TInt i( 0 ); i < implArray.Count() && err == KErrNotFound; ++i )
        {
        if ( aOpaqueData.CompareF( implArray[i]->OpaqueData() ) == 0 &&
             implArray[i]->VendorId() == VID_DEFAULT  )
            {
            err = KErrNone;
            iUiPlugin = 
                CWmDrmDlaUiPluginIf::NewL( implArray[i]->ImplementationUid() );
            }
        }
    if ( err == KErrNotFound )
        {
        err = KErrNone;
        iUiPlugin = CWmDrmDlaUiPluginIf::NewL( KWmDrmDlaDefaultUiPluginUid );
        }
    CleanupStack::PopAndDestroy( &implArray );
    }
Example #11
0
/**
	Checks whether any duplicate parameter names exist in the 
	whole path of the sip-uri.
							
	@param		aParamName	The descriptor to be checked.
	@param		aParamList	the path/parameter part of uri, which conatians all parameters and values.
	@return		A boolean value of ETrue if uri contains duplicate parameters,
				EFalse if it does not.
*/
TBool TValidatorSip::IsDuplicated(const TDesC8& aParamName, const TDelimitedParserBase8 aParamList) const
	{
	// roll back to the start of the lhs segment parser
	while(aParamList.Dec() != KErrNotFound) 
	{
	//Nothing to do
	}
	
	TPtrC8 name;
	TPtrC8 value;
	TPtrC8 segment;
	TInt count = 0;
	while( aParamList.GetNext(segment) == KErrNone )
		{
		GetNameValuePair(segment, name, value);
		if (aParamName.CompareF(name) == 0)
			{
			count++;
			}
		if (count > 1)
			{
			// The parameter name appears more than once in the paramter list
			return ETrue;
			}
		}
	return EFalse;	
	}
Example #12
0
// ----------------------------------------------------------
// CSimpleFilter::ValidateXmlL
// ----------------------------------------------------------
//
void CSimpleFilter::ValidateXmlL( const TDesC8& aName )
    {
    if ( aName.CompareF( KFilterLocalName ) )
        {
        User::Leave( KErrCorrupt );
        }        
    }
void CConvertToRfc1123FormTest::ConvertSingleTestL(TDateTime aDateTime, const TDesC8& aExpectedResult)
{
    TInternetDate internetDate(aDateTime);
    HBufC8* textDate = internetDate.InternetDateTimeL(TInternetDate::ERfc1123Format);
    CleanupStack::PushL(textDate);
    if (aExpectedResult.CompareF(*textDate) != 0)
        User::Leave(KErrCorrupt);

    CleanupStack::PopAndDestroy(textDate);
}
Example #14
0
// -----------------------------------------------------------------------------
// CMceSdpCodec::IsSupported
// -----------------------------------------------------------------------------
TBool CMceSdpCodec::IsSupported( const TDesC8& aCapability ) const
    {
    TBool isSupported = EFalse;
    TInt index = 0;
    
    while( !isSupported && index < iCapabilities->Count() )
        {
        isSupported = !aCapability.CompareF( iCapabilities->MdcaPoint( index ++ ) );
        }
    
    return isSupported;
    
    }
Example #15
0
void CLANLinkCommon::ProvisionBearerConfigL(const TDesC8& aName)
	{
	TInt index = -1;
	CLanxBearer* bearer = FindBearerByProtocolName(aName, index);
	if (bearer)
		{
        if (aName.CompareF(KDescIp) == 0)
		    {
		    if (iLanIp4Provision)
		        {
		        bearer->SetProvisionL(iLanIp4Provision); // CLanIp4Bearer
		        }
		    }
		else if (aName.CompareF(KDescIp6) == 0)
		    {
		    if (iLanIp6Provision)
		        {
		        bearer->SetProvisionL(iLanIp6Provision); // CLanIp6Bearer
		        }
		    }
		}
	}
Example #16
0
// -----------------------------------------------------------------------------
// CMccCodecRed::SetSdpName
// Sets the SDP name
// -----------------------------------------------------------------------------
TInt CMccCodecRed::SetSdpName( const TDesC8& aSdpName )
    {
    if ( !aSdpName.CompareF( KRedSdpName ) )
        {
        iSdpName.Copy( aSdpName );
        }
    else 
        {
        return KErrNotSupported;
        }
    
    return KErrNone;
    }
// -----------------------------------------------------------------------------
// CMCCCodecILBC::SetSdpName
// Set SDP Name
// -----------------------------------------------------------------------------
//
TInt CMCCCodecILBC::SetSdpName( const TDesC8& aSdpName )
    {
    if ( !aSdpName.CompareF( KILBCSdpName ) )
        {
        iSdpName.Copy( aSdpName );
        }
    else 
        {
        return KErrNotSupported;        
        }
        
    return KErrNone;
    }
void CContextparser::ParseContentL(const TDesC8& aBytes)
	{
	if(aBytes.CompareF(KNewLineConst)!=0)
		{
		if(iVersionparsed)
			{
			iRights.AddVersionL(aBytes);
			}
		else if(iUidParsed)
			{
			iRights.AddUidL(aBytes);		
			}
		}
	}
void CIAUpdateNodeEmbeddedXmlParser::OnContentL( const TDesC8& aBytes, 
                                                 TInt aErrorCode )
    {
    // If the parent wants to do something with the information.
    CIAUpdateXmlSubParser::OnContentL( aBytes, aErrorCode );

    // Check if this is the leaf parser and no other sub parser should 
    // handle this.
    if ( AcceptData() )
        {
        // We have gotten content for this element.
        // Now, set the node information to the dependency object.
        _LIT8( KTrue, "true" );
        _LIT8( KFalse, "false" );
        _LIT8( KOneTrue, "1" );
        _LIT8( KZeroFalse, "0" );

        TBool embedded( EFalse );    
        if ( aBytes.CompareF( KTrue() ) == 0 
             || aBytes.CompareF( KOneTrue() ) == 0 )
            {
            embedded = ETrue;
            }
        else if ( aBytes.CompareF( KFalse() ) == 0 
                  || aBytes.CompareF( KZeroFalse() ) == 0 )
            {
            embedded = EFalse;
            }
        else
            {
            // The content is corrupted.
            User::Leave( KErrArgument );
            }
            
        DependencyL().SetEmbedded( embedded );
        }
    }
void CMMFFormatImplementationInformation::ProcessTaggedDataL(const TDesC8& aTag, const TDesC8& aTagData)
	{
	if (aTag == KSupplier)
		SetSupplierL(aTagData);
	else if (aTag == KMediaId)
		AddMediaIdL(aTagData);
	else if (aTag == KFormatFileExtension)
		AddFileExtensionL(aTagData);
	else if (aTag == KFormatMimeType)
		AddMimeTypeL(aTagData);
	else if (aTag == KFormatHeaderData)
		AddHeaderDataL(aTagData);
	else if ((aTag == KCustomInterfaceSupport) && (aTagData.CompareF(KTagYes) == 0))
		iBody->SetSupportsCustomInterfaces(ETrue);
	else
		User::Leave(KErrCorrupt);
	}
/**
	Sets the Network capability found in opaque data
	
	@param  aNetworkCapable
			Declares the incapability to support uri if matches to 'yes'. 
			If this is the case, iIsNetworkCtrl is set to EFalse
*/
void CMMFControllerImplementationInformation::SetNetworkCapabilityL(const TDesC8& aNetworkCapable)
	{
	//If a uri scheme is already declared in the resource file, 
	//then mentioning no url support is illegal
	if(iUriSchemes->Count() > 0)
		{
		User::Leave(KErrArgument);
		}
		
	if (aNetworkCapable.CompareF(KTagYes) == KErrNone)
		{
		iIsNetworkCtrl = EFalse;
		}
	else
		{
		User::Leave(KErrBadName); // will leave if aNetworkCapable is anything other than 'yes'.
		}
	}
Example #22
0
void CRtaServer::EraseDeleteKeyL(const TDesC8& aDeleteKey)
	{
	TInt changed = 0;
	for (TInt i = 0; i < iRights.Count(); i++)
		{
		CRightsObject* ro = iRights[i];
		if ( 0 == aDeleteKey.CompareF(ro->DeleteKey()) )
			{
			ro->SetDeleteKeyL(KNullDesC8);
			changed++;
			}
		}

	if (changed)
		{
		SaveRightsDatabaseL();
		}
	}
Example #23
0
// -----------------------------------------------------------------------------
// CMceSdpCodec::IsPayloadTypeSupported
// -----------------------------------------------------------------------------
TBool CMceSdpCodec::IsPayloadTypeSupported( const TDesC8& aCapability, const TUint aPayloadType ) const
    {
    TBool isSupported = EFalse;
    TInt index = 0;
    
    while( !isSupported && index < iCapabilities->Count() )
        {
        if ( !aCapability.CompareF( iCapabilities->MdcaPoint( index ) ) &&  index < iCapabilitiesPT.Count())
        	{
        	if (iCapabilitiesPT [ index ] >= KMinDynamicPT || iCapabilitiesPT [ index ] == aPayloadType)
        		{
        		isSupported = ETrue;
        		}
        	}
        index ++;
        }
    
    return isSupported;
    
}
Example #24
0
void CRtaServer::DeleteRightsByKeyL(const TDesC8& aDeleteKey)
	{
	TInt origCount = iRights.Count();
	for(TInt i = origCount - 1; i >= 0; i--)
		{
		CRightsObject* ro = iRights[i];
		if ( 0 == aDeleteKey.CompareF(ro->DeleteKey()) )
			{
			iRights.Remove(i);
			delete ro;
			}
		}

	if (iRights.Count() < origCount)
		{
		SaveRightsDatabaseL();
		}
	else
		{
		User::Leave(KErrNotFound);
		}
	}
// ---------------------------------------------------------------------------
// CSdpMediaField::KeepFormatL
// ---------------------------------------------------------------------------
//
EXPORT_C void CSdpMediaField::KeepFormatL(const TDesC8& aFormat)
{
    if ( !iFormatList )
    {
        User::Leave( KErrSdpCodecMediaField );
    }
    // Empty set will continue to be empty
    if ( iFormatList->Des().Length() > 0 )
    {
        HBufC8* formatList = aFormat.AllocLC();
        // Mark all format attributes not aFormat so that they will be deleted
        RArray<TInt> removedObjs;
        CleanupClosePushL( removedObjs );
        for ( TInt i( 0 ); i < iFmtAttrFields->Count(); i++ )
        {
            if (aFormat.CompareF((*iFmtAttrFields)[i]->Format()) != 0)
            {
                User::LeaveIfError( removedObjs.Append( i ) );
            }
        }
        // Delete attribute fields
        TInt removedCount( 0 );
        while ( removedObjs.Count() > 0 )
        {
            CSdpFmtAttributeField* obj =
                (*iFmtAttrFields)[removedObjs[0] - removedCount];
            delete obj;
            iFmtAttrFields->Remove( removedObjs[0] - removedCount );
            removedObjs.Remove( 0 );
            removedCount++;
        }
        CleanupStack::PopAndDestroy();  // removedObjs
        // Change format list
        delete iFormatList;
        iFormatList = formatList;
        CleanupStack::Pop();    // formatList
    }
}
Example #26
0
void CIniLoggingPairs::AddSettingL(const TDesC8& aSubsystem, const TDesC8& aComponent)
	{
	TBool subsystemIsNewInList(EFalse);
	CSubsystemSettings* subsystemSetting;
	iProbeSubsystem->SetSubsystemName(aSubsystem);
	TInt subsysPos = iSubsystems.FindInOrder(iProbeSubsystem, TLinearOrder<CSubsystemSettings>(CSubsystemSettings::CompareCSubsystemSettings));
	if (subsysPos == KErrNotFound)
		{
		subsystemSetting = new(ELeave) CSubsystemSettings(aSubsystem);
		CleanupStack::PushL(subsystemSetting);
		iSubsystems.InsertInOrderL(subsystemSetting, TLinearOrder<CSubsystemSettings>(CSubsystemSettings::CompareCSubsystemSettings));
		subsystemIsNewInList = ETrue;
		CleanupStack::Pop(subsystemSetting);
		}
	else 
		{
		ASSERT(subsysPos >= KErrNone);
		subsystemSetting = iSubsystems[subsysPos];
		}
	//subsystemSetting is now owned in the array, so we don't need to worry about any leaves from here on.
	if (aComponent.CompareF(KSubsystemWildCard)==0)
		{
		subsystemSetting->SetWildCarded(ETrue);
		return;
		}
	TInt err;
	if ((err = subsystemSetting->AddComponent(aComponent))!=KErrNone)
		{
		if (subsystemIsNewInList)
			{
			delete subsystemSetting;
			iSubsystems.Remove(subsysPos);
			User::Leave(err);
			}
		}
	}
// ----------------------------------------------------------------------------
// CSIPSecAgreement::NextHop
// ----------------------------------------------------------------------------
//	
TBool CSIPSecAgreement::NextHop( const TDesC8& aNextHop ) const
	{
	return aNextHop.CompareF( *iNextHop ) == 0;
	}
// ---------------------------------------------------------------------------
// Received a response header
// ---------------------------------------------------------------------------
//	
void CCatalogsHttpTransaction::ResponseHeaderReceived( const TDesC8& aHeader, 
    const TDesC8& aValue )
    {
    DLTRACEIN( ("") );
    DASSERT( iObserver );
    
    TRAPD( err, iResponseHeaders->AddHeaderL( aHeader, aValue ) );        
    if ( err != KErrNone )
        {
        HandleHttpError( ECatalogsHttpErrorGeneral, err );
        return;
        }
        
    iState.iOperationState = ECatalogsHttpOpInProgress;
    iState.iProgressState = ECatalogsHttpResponseHeaderReceived;
         
    
    if ( aHeader.CompareF( KHttpContentRangeHeader ) == 0 )
        {
        //
        // Content-Range, bytes x-y/z
        // Extract 'z' and use it as the total content length
        //
        TPtrC8 ptr( aValue );
        TInt offset = ptr.Locate( '/' );
        if ( offset != KErrNotFound )
            {
            TLex8 val;
            val.Assign( ptr.Mid( offset + 1 ) );

            TInt value;
            TInt err = val.Val( value );
            if ( err == KErrNone )
                {
                iContentLength = value;
                DLTRACE(( "Content length: %i", iContentLength ));
                }
            }
        }
    else if ( aHeader.CompareF( KHttpContentLengthHeader ) == 0 )
        {
        //
        // If content length for this request has not been already set
        // e.g. from a Content-Range header, extract from Content-Length header
        //
        if ( iContentLength == 0 )
            {
            TLex8 val;
            val.Assign( aValue );

            TInt value;
            TInt err = val.Val( value );
            if ( err == KErrNone )
                {
                iContentLength = value;
                DLTRACE(( "Content length: %i", iContentLength ));
                }                
            }
        else
            {
            DLTRACE(( "-> ContentLength set, ignoring" ));
            }
        }
    else if ( aHeader.CompareF( KHttpContentTypeHeader ) == 0 ) 
        {
        // Content type from the header
        DLTRACE( ( "Content type received" ) );
        
        TRAPD( err, SetContentTypeL( aValue ) );
        if ( err != KErrNone ) 
            {
            DLTRACE( ( "Content type setting failed with err: %i",
                err ) );
            HandleHttpError( ECatalogsHttpErrorGeneral, err );
            return;
            }          
        else 
            {
            iState.iProgressState = ECatalogsHttpContentTypeReceived;
            }
        }
         
    // Report the observer that a header has been received
    NotifyObserver();
    }
void CRefTestAgentImportFile::ConstructL(const TDesC8& aMimeType, const CMetaDataArray& aMetaDataArray, const TDesC& aOutputDirectory, const TDesC& aSuggestedFileName)
	{
	TPtrC suggestedFileName(aSuggestedFileName);	
	TPtrC outputDirectory(aOutputDirectory);
	
	// make sure any suggested extension is removed
	// otherwise our recognizer won't work
	TInt pos = aSuggestedFileName.LocateF(TChar(KExtDelimiter));
	if(pos != KErrNotFound)
		{
		// set the length so the extension is not included
		suggestedFileName.Set(aSuggestedFileName.Left(pos));
		}

	// If no output directory is suggested default to "c:\\" 
	if(outputDirectory.Length() == 0)
		{
		outputDirectory.Set(KRtaDefaultOutputDirectory());
		}

	// If no file name is suggested default to "output" 
	if(suggestedFileName.Length() == 0)
		{
		suggestedFileName.Set(KRtaDefaultOutputFile());
		}
	
	//Only files containing rights, post-acquisition rights or postacquisition content need to be imported
	if(!aMimeType.CompareF(KRtaMimeRights()) || !aMimeType.CompareF(KRtaMimeContentRights()))
		{// Files containing rights
		iMimeType = ReferenceTestAgent::EMimeContentOrRights;
		}
	else if(!aMimeType.CompareF(KRtaMimePostAcquisitionRights()))
		{// Files containing post-acquisition rights
		iMimeType = ReferenceTestAgent::EMimePostAcquisitionRights;
		}
	else if(!aMimeType.CompareF(KRtaMimePostAcquisitionContent()))
		{// Files containing post-acquisition content
		iMimeType = ReferenceTestAgent::EMimePostAcquisitionContent;
		}
	else
		{//Others are not supported
		User::Leave(KErrCANotSupported);
		}

	// create buffer to store the output directory supplied by the client
	// Append a trailing slash if there is no slash present
	iOutputDirectory = HBufC::NewL(outputDirectory.Length() + 1);
	iOutputDirectory->Des().Copy(outputDirectory);
	if(outputDirectory[outputDirectory.Length() - 1] != KPathDelimiter)
		{
		iOutputDirectory->Des().Append(TChar(KPathDelimiter));
		}
	
	// Create suggested file name by combining output directory and suggested name
	// Use the length of KRtaExtensionContentRights since it is the longest one
	iSuggestedFileName = HBufC::NewL(iOutputDirectory->Des().Length() + suggestedFileName.Length() + KRtaExtensionContentRights().Length());
	iSuggestedFileName->Des().Copy(*iOutputDirectory);
	iSuggestedFileName->Des().Append(suggestedFileName);
	switch(iMimeType)
	{
	case ReferenceTestAgent::EMimeContentOrRights:
	case ReferenceTestAgent::EMimePostAcquisitionContent:
		iSuggestedFileName->Des().Append(KRtaExtensionContent());
		break;
	case ReferenceTestAgent::EMimePostAcquisitionRights:
		iSuggestedFileName->Des().Append(KRtaExtensionPostAcquisitionRights());
	};

	// Create a file handle
	User::LeaveIfError(iFs.Connect());
	
	// create importer object
	if (iAgentCreatesOutputFiles)
		{
		iImporter = ReferenceTestAgent::CRefTestAgentImport::NewL(*iSuggestedFileName, iFs, iMimeType);
		}
	else
		{
		iImporter = ReferenceTestAgent::CRefTestAgentImport::NewL(KNullDesC, iFs, iMimeType);
		}
	
	if(iMimeType == ReferenceTestAgent::EMimePostAcquisitionContent)
		{
		//In the post-acquisition case, the rights object is installed separately and the content
		//comes without a content-xml file. It means that there is no way to extract the Content Id.
		//Therefore, the Content Id is sent as a meta-data while importing a post-acquisition content. cid=<content_id>
		iImporter->SetMetaDataL(aMetaDataArray);
		}
		
	DumpMetaData(aMetaDataArray);
	
	// create input data log
	RFile inputDataFile;
	inputDataFile.Replace(iFs, KInputDataLogFile(), EFileWrite | EFileStream);
	inputDataFile.Close();
	}
TBool CTestConfig::IsDefaultSection(const TDesC8& aSectionName) const
	{
	TBool retVal = (aSectionName.CompareF(KScriptDefaults) == 0);
	retVal = retVal || (aSectionName.CompareF(KScriptDefault1) == 0);
	return retVal;
	}