1 /* |
1 /* |
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
273 |
273 |
274 if ( aUserAgentHeaders ) |
274 if ( aUserAgentHeaders ) |
275 { |
275 { |
276 if ( iIncomingReplaces && IsAttended() ) |
276 if ( iIncomingReplaces && IsAttended() ) |
277 { |
277 { |
278 SVPDEBUG1( "CSVPTransferStateContext::SetTransferDataL: add replaces header" ) |
278 SVPDEBUG1( "CSVPTransferStateContext::SetTransferDataL: Add replaces header" ) |
279 TBuf8<KSVPTempStringlength> replacesString; |
279 // fetch "replaces:" string |
280 replacesString.Append( KSVPReplacesColonTxt ); |
280 HBufC* replacesStringHeap16 = IncomingReplaces().AllocLC(); // CS: 1 |
281 // add IncomingReplaces |
281 |
282 replacesString.Append( IncomingReplaces() ); |
282 // Copy incoming replaces to 8-bit buffer |
|
283 HBufC8* replacesStringHeap8 = |
|
284 HBufC8::NewLC( replacesStringHeap16->Length() + |
|
285 KSVPReplacesColonTxt().Length() ); // CS: 2 |
|
286 |
|
287 replacesStringHeap8->Des().Copy( *replacesStringHeap16 ); |
|
288 CleanupStack::Pop( 1 ); |
|
289 CleanupStack::PushL( replacesStringHeap8 ); // ReAlloc possible |
|
290 |
|
291 // add replaces header |
|
292 replacesStringHeap8->Des().Insert( 0, KSVPReplacesColonTxt ); |
|
293 CleanupStack::Pop( 1 ); |
|
294 CleanupStack::PushL( replacesStringHeap8 ); // ReAlloc possible |
|
295 SVPDEBUG2( "CSVPTransferStateContext::SetTransferDataL - length: %d", replacesStringHeap8->Length() ) |
|
296 |
283 // Finally add collected Replaces string to header |
297 // Finally add collected Replaces string to header |
284 aUserAgentHeaders->AppendL( replacesString ); |
298 aUserAgentHeaders->AppendL( *replacesStringHeap8 ); |
|
299 CleanupStack::PopAndDestroy( replacesStringHeap8 ); // CS: 1 |
|
300 CleanupStack::PopAndDestroy( replacesStringHeap16 ); // CS: 0 |
285 } |
301 } |
286 |
302 |
287 if ( iIncomingReferredBy ) |
303 if ( iIncomingReferredBy ) |
288 { |
304 { |
289 SVPDEBUG1( "CSVPTransferStateContext::SetTransferDataL: Add referredBy header" ) |
305 SVPDEBUG1( "CSVPTransferStateContext::SetTransferDataL: Add referredBy header" ) |
734 // --------------------------------------------------------------------------- |
750 // --------------------------------------------------------------------------- |
735 // |
751 // |
736 TInt CSVPTransferStateContext::CheckAuthidentity( const TDesC8& aUri ) const |
752 TInt CSVPTransferStateContext::CheckAuthidentity( const TDesC8& aUri ) const |
737 { |
753 { |
738 SVPDEBUG1( "CSVPTransferStateContext::CheckAuthidentity" ) |
754 SVPDEBUG1( "CSVPTransferStateContext::CheckAuthidentity" ) |
739 return ( aUri.Find( KSVPAuthidentity ) ); |
755 TInt returnValue = aUri.Find( KSVPAuthidentity ); |
|
756 SVPDEBUG2( "CSVPTransferStateContext::CheckAuthidentity return: %d", returnValue ) |
|
757 if ( returnValue == KErrNotFound ) |
|
758 { |
|
759 returnValue = aUri.Find( KSVPAuthidentity2 ); |
|
760 SVPDEBUG2( "CSVPTransferStateContext::CheckAuthidentity second return: %d", returnValue ) |
|
761 } |
|
762 return returnValue; |
740 } |
763 } |
741 |
764 |
742 // --------------------------------------------------------------------------- |
765 // --------------------------------------------------------------------------- |
743 // CSVPTransferStateContext::IncomingReferTo |
766 // CSVPTransferStateContext::IncomingReferTo |
744 // --------------------------------------------------------------------------- |
767 // --------------------------------------------------------------------------- |