Symbian3/SDK/Source/GUID-765A6D87-5C2C-4E79-9EA5-9F8930062ED0.dita
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-765A6D87-5C2C-4E79-9EA5-9F8930062ED0" xml:lang="en"><title>Enabling
       
    13 MHTTPDataOptimiser for a session</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>You must use the <codeph>RHTTPSession::SetupHTTPDataOptimiser()</codeph> function
       
    15 of the <codeph>RHTTPSession</codeph> class to enable the <codeph>MHTTPDataOptimiser</codeph> implementation
       
    16 for a session. The following code illustrates the <codeph>RHTTPSession</codeph> class: </p>
       
    17 <codeblock id="GUID-1635E0AC-8119-5575-934F-A292D7C04D40" xml:space="preserve">class RHTTPSession 
       
    18 {
       
    19 public:
       
    20 ……    
       
    21 
       
    22 RHTTPSession::SetupHTTPDataOptimiser (MHTTPDataOptimiser&amp; aHTTPOptimiser);
       
    23 
       
    24 MHTTPDataOptimiser* RHTTPSession::HTTPDataOptimiser ();
       
    25 
       
    26 };</codeblock>
       
    27 <p>For a session, if you want to prevent a transaction from using the MHTTPDataOptimiser
       
    28 implementation, see the <xref href="GUID-F0ABCDE5-F818-526A-81EB-E2D4D87E3231.dita#GUID-F0ABCDE5-F818-526A-81EB-E2D4D87E3231/GUID-BF90ED54-70D7-574C-8A4D-1C74270A3883">Overriding
       
    29 the optimiser for a session</xref> section. </p>
       
    30 <p> <b>Note:</b> For more information about how to enable the <codeph>MHTTPDataOptimiser</codeph> implementation
       
    31 for a session, see the <xref href="GUID-F0ABCDE5-F818-526A-81EB-E2D4D87E3231.dita#GUID-F0ABCDE5-F818-526A-81EB-E2D4D87E3231/GUID-F8AA1DE9-791E-5954-84E8-ACCBDFB8D3E3">HTTP
       
    32 Whole Message Filter example</xref> section. </p>
       
    33 <section id="GUID-A527468C-12FE-56FB-8FA2-6EF75E3B31D5"><title>Overriding
       
    34 the optimiser for a session</title> <p>By default, if the <codeph>MHTTPDataOptimiser</codeph> implementation
       
    35 is enabled for a session, it applies to all transactions within the session
       
    36 when the <codeph>MHTTPDataOptimiser</codeph> implementation is not enabled
       
    37 for individual transactions. In a scenario where you want to prevent a particular
       
    38 transaction (for which <codeph>MHTTPDataOptimiser</codeph> implementation
       
    39 is not enabled) of a session from using the <codeph>MHTTPDataOptimiser</codeph> implementation
       
    40 of the session, set the <codeph>EHTTPTransOptimiser</codeph> property with
       
    41 the value <b>EDisableHTTPTransOptimiser</b> on that transaction. </p> <p>The
       
    42 following code illustrates how to set the <codeph>EHTTPTransOptimiser</codeph> property: </p> <codeblock id="GUID-0813EB6E-29B7-56D1-9AFC-60E7EDB8AE18" xml:space="preserve">// HTTP session object
       
    43 RHTTPSession sess; 
       
    44 
       
    45 // The MHTTPDataOptimiser implementation is enabled for a session.
       
    46 sess.SetupHttpDataOptimiser(*this); 
       
    47 
       
    48 // HTTP transaction object
       
    49 RHTTPTransaction trans = sess.OpenTransactionL(const TUriC8&amp;, MHTTPTransactionCallback&amp;, RStringF);
       
    50 THTTPHdrVal disableOptimiser(sess.StringPool().StringF(HTTP::EDisableHTTPTransOptimiser,    RHTTPSession::GetTable()));
       
    51 trans.PropertySet().SetPropertyL(sess.StringPool().StringF(HTTP::EHTTPTransOptimiser,    RHTTPSession::GetTable()), disableOptimiser);
       
    52 </codeblock> </section>
       
    53 </conbody></concept>