syncmlfw/common/http/src/nsmlhttp.cpp
changeset 5 3f7d9dbe57c8
parent 0 b497e44ab2fc
child 9 57a65a3a658c
child 22 19fb38abab1d
--- a/syncmlfw/common/http/src/nsmlhttp.cpp	Tue Jan 26 12:43:57 2010 +0200
+++ b/syncmlfw/common/http/src/nsmlhttp.cpp	Tue Feb 02 00:44:00 2010 +0200
@@ -22,6 +22,7 @@
 #include <DevManInternalCRKeys.h>
 #include <centralrepository.h>
 #include "nsmlprivatepskeys.h"
+#include <nsmlconstants.h>
 
 
 #include "nsmlerror.h"
@@ -143,6 +144,16 @@
             iMaxMsgSize = value;
             }
         }
+    
+    CRepository* rep = CRepository::NewLC(KCRUidNSmlDSEngine);
+    TInt flag(0);
+    TRAPD(err, rep->Get(KNsmlDsDeflateSupport, flag));
+    DBG_FILE_CODE(flag, _S8("Flag value"));
+    if ( err == KErrNone )
+        {
+        iDeflateFlag = flag;
+        }
+    CleanupStack::PopAndDestroy(rep);
 	}
 
 // ---------------------------------------------------------
@@ -565,7 +576,7 @@
 	delete iReqBodySubmitBuffer;
     iReqBodySubmitBuffer = NULL;
 	
-	if( (iSession == ESyncMLDSSession) && (iServerAcceptEncoding == ExptDeflate) )
+	if( (iSession == ESyncMLDSSession) && (iServerAcceptEncoding == ExptDeflate) && iDeflateFlag )
 		{
 		TRAPD( err, CompressL(aStartPtr) );
 		User::LeaveIfError( err );
@@ -1070,13 +1081,13 @@
 	SetHeaderL( hdr, HTTP::EAcceptCharset, KSmlAcceptCharSet );
 	SetHeaderL( hdr, HTTP::EAcceptLanguage , KSmlAcceptLanguage );
 		
-	if( iSession == ESyncMLDSSession )//for ds session
-	  { 
+	if( iSession == ESyncMLDSSession && iDeflateFlag )//for ds session
+	  {
 	  if(iServerAcceptEncoding == ExptDeflate)
-	      {
-	      SetHeaderL( hdr, HTTP::EContentEncoding , KSmlContentDeflate );
-	      }
-	      SetHeaderL( hdr, HTTP::EAcceptEncoding , KSmlContentDeflate );
+          {
+          SetHeaderL( hdr, HTTP::EContentEncoding , KSmlContentDeflate );
+          }
+          SetHeaderL( hdr, HTTP::EAcceptEncoding , KSmlContentDeflate );
 	  }
 
 	// Add headers and body data for methods that use request bodies
@@ -1135,7 +1146,7 @@
 		}
 		else
 		{
-		    if ( (iSession == ESyncMLDSSession) && (iServerContentEncoding == ExptDeflate) )
+		    if ( (iSession == ESyncMLDSSession) && (iServerContentEncoding == ExptDeflate) && iDeflateFlag )
 		        {		    
 		        TRAPD( err, DecompressL( aStartPtr ) );		    
 				User::LeaveIfError( err );