omadrm/drmplugins/drmfilter/src/HTTPFilterDRM.cpp
changeset 23 493788a4a8a4
parent 0 95b198f216e5
child 31 908beac81e0a
child 71 1221b68b8a5f
equal deleted inserted replaced
5:79d62d1d7957 23:493788a4a8a4
    19 #include <http/rhttpheaders.h>
    19 #include <http/rhttpheaders.h>
    20 #include <http/rhttpresponse.h>
    20 #include <http/rhttpresponse.h>
    21 #include <httpstringconstants.h>
    21 #include <httpstringconstants.h>
    22 #include <httperr.h>
    22 #include <httperr.h>
    23 #include <bautils.h>
    23 #include <bautils.h>
    24 #include <drmmessageparser.h>
    24 #include <DRMMessageParser.h>
    25 
    25 
    26 #include "httpfilterdrm.h"
    26 #include "HTTPFilterDRM.h"
    27 
    27 
    28 // LOCAL CONSTANTS
    28 // LOCAL CONSTANTS
    29 _LIT8( KDRMString1, "application/vnd.oma.drm.message" );
    29 _LIT8( KDRMString1, "application/vnd.oma.drm.message" );
    30 // FL or CD
    30 // FL or CD
    31 
    31 
   462 // Check HTTP headers and extract MIME type
   462 // Check HTTP headers and extract MIME type
   463 //------------------------------------------------------------------------
   463 //------------------------------------------------------------------------
   464 // 
   464 // 
   465 void CHTTPFilterDRM::CheckHeadersL( const RHTTPTransaction& aTrans )
   465 void CHTTPFilterDRM::CheckHeadersL( const RHTTPTransaction& aTrans )
   466     {
   466     {
   467     // read the header data and check the MIME type here	
   467     // read the header data and check the MIME type here    
   468     // check the status and body
   468     // check the status and body
   469     RHTTPResponse response = aTrans.Response();
   469     RHTTPResponse response = aTrans.Response();
   470     TInt status = response.StatusCode();
   470     TInt status = response.StatusCode();
   471 
   471 
   472 #if defined (_DEBUG) && defined (_LOGGING)
   472 #if defined (_DEBUG) && defined (_LOGGING)
   628         CleanupStack::PopAndDestroy( &cfmValStr );
   628         CleanupStack::PopAndDestroy( &cfmValStr );
   629 
   629 
   630         // Do not encrypt JAD files:
   630         // Do not encrypt JAD files:
   631         if ( headers.GetField( fieldNameStr, 0, fieldVal ) == KErrNone )
   631         if ( headers.GetField( fieldNameStr, 0, fieldVal ) == KErrNone )
   632             {
   632             {
   633             // If it is a JAD always ignore any of the above:	
   633             // If it is a JAD always ignore any of the above:   
   634             const TBuf8<sizeof( KJADString )> JADStringBuf( KJADString );
   634             const TBuf8<sizeof( KJADString )> JADStringBuf( KJADString );
   635             RStringF JADValue = strP.OpenFStringL( JADStringBuf );
   635             RStringF JADValue = strP.OpenFStringL( JADStringBuf );
   636             CleanupClosePushL( JADValue );
   636             CleanupClosePushL( JADValue );
   637 
   637 
   638             RStringF jadFieldValStr = strP.StringF( fieldVal.StrF() );
   638             RStringF jadFieldValStr = strP.StringF( fieldVal.StrF() );
   663                 }
   663                 }
   664 
   664 
   665             iDataSups.Append( drmData );
   665             iDataSups.Append( drmData );
   666             response.SetBody( *drmData );
   666             response.SetBody( *drmData );
   667 
   667 
   668             ///			
   668             ///         
   669             RStringF DRMValue1 = strP.OpenFStringL( DRMStringBuf1 );
   669             RStringF DRMValue1 = strP.OpenFStringL( DRMStringBuf1 );
   670             CleanupClosePushL( DRMValue1 );
   670             CleanupClosePushL( DRMValue1 );
   671 
   671 
   672             RStringF DRMValue3 = strP.OpenFStringL( DRMStringBuf3 );
   672             RStringF DRMValue3 = strP.OpenFStringL( DRMStringBuf3 );
   673             CleanupClosePushL( DRMValue3 );
   673             CleanupClosePushL( DRMValue3 );