--- a/applayerpluginsandutils/httpprotocolplugins/httpheadercodec/chttpgeneralheaderwriter.cpp Tue Apr 27 17:12:14 2010 +0300
+++ b/applayerpluginsandutils/httpprotocolplugins/httpheadercodec/chttpgeneralheaderwriter.cpp Tue May 11 16:43:01 2010 +0300
@@ -22,6 +22,7 @@
#include "CHeaderField.h"
_LIT8(KSemiSpaceSep,"; ");
+_LIT8(KCommaSpaceSep,", ");
CHttpGeneralHeaderWriter* CHttpGeneralHeaderWriter::NewL(RStringPool aStringPool)
/**
@@ -91,7 +92,53 @@
directly
*/
{
- DoTokenCsvListHeaderL(aHeader, KErrHttpEncodeCacheControl);
+ THeaderFieldPartIter iter = aHeader.PartsL();
+ iter.First();
+ if (iter.AtEnd())
+ User::Leave(KErrHttpEncodeCacheControl);
+
+ aHeader.BeginRawDataL();
+ do
+ {
+ const CHeaderFieldPart* part = iter();
+ if(part == NULL)
+ User::Leave(KErrHttpEncodeCacheControl);
+ THTTPHdrVal ptVal = part->Value();
+ if (ptVal.Type() != THTTPHdrVal::KStrFVal)
+ User::Leave(KErrHttpEncodeCacheControl);
+ const TDesC8& val = ptVal.StrF().DesC();
+ if(val.Length() > 0)
+ {
+ aHeader.WriteRawDataL(val);
+ }
+ else
+ {
+ // Now we must have part as the strF value is KNulLDesC8
+ THeaderFieldParamIter iter2 = part->Parameters();
+ if(!iter2.AtEnd())
+ {
+ const CHeaderFieldParam* param = iter2();
+ aHeader.WriteRawDataL(param->Name().DesC());
+ aHeader.WriteRawDataL('=');
+ THTTPHdrVal val2 = param->Value();
+ if(val2.Type() == THTTPHdrVal::KTIntVal)
+ {
+ TBuf8<32> desc;
+ desc.AppendNum(val2.Int());
+ aHeader.WriteRawDataL(desc);
+ }
+ else if(val2.Type() == THTTPHdrVal::KStrFVal)
+ {
+ aHeader.WriteRawDataL(param->Name().DesC());
+ }
+ }
+ }
+ ++iter;
+ if(!iter.AtEnd())
+ aHeader.WriteRawDataL(KCommaSpaceSep());
+
+ }while(!iter.AtEnd());
+ aHeader.CommitRawData();
}
void CHttpGeneralHeaderWriter::EncodeConnectionL(RHeaderField& aHeader) const
--- a/applayerprotocols/httptransportfw/Test/T_HttpOffline/t_hdrcodec.cpp Tue Apr 27 17:12:14 2010 +0300
+++ b/applayerprotocols/httptransportfw/Test/T_HttpOffline/t_hdrcodec.cpp Tue May 11 16:43:01 2010 +0300
@@ -87,6 +87,7 @@
ResetTimeElapsed();
// Run tests on parsed -> OTA data conversions, for each header implemented
+ TestDecodeEncodeCacheControlL();
TestEncodeAcceptL();
TestEncodeAcceptCharsetL();
TestEncodeAuthorizationL();
@@ -292,6 +293,53 @@
}
+void CHttpHdrCodecTest::TestDecodeEncodeCacheControlL()
+ {
+ _LIT8(KCacheControlOTAVal, "private, max-age=360, must-revalidate");
+ RStringF cacheControl = iStrP.StringF(HTTP::ECacheControl,RHTTPSession::GetTable());
+ RStringF maxAge = iStrP.StringF(HTTP::EMaxAge,RHTTPSession::GetTable());
+ RHTTPHeaders hdr = GetHeadersLC();
+ hdr.SetRawFieldL(cacheControl, KCacheControlOTAVal, KFieldSeparator);
+ if(hdr.FieldPartsL(cacheControl) != 3)
+ {
+ iEngine->Utils().LogIt(_L("\nCache-Control OTA comparison failed -> [parts != 3]"));
+ User::Leave(KErrCorrupt);
+ }
+ THTTPHdrVal hVal;
+ User::LeaveIfError(hdr.GetField(cacheControl,0,hVal));
+ if(hVal.StrF().DesC().Compare(_L8("private")) != 0)
+ {
+ iEngine->Utils().LogIt(_L("\nCache-Control OTA comparison failed -> [private]"));
+ User::Leave(KErrCorrupt);
+ }
+ THTTPHdrVal paramVal;
+ User::LeaveIfError(hdr.GetParam(cacheControl, maxAge, paramVal, 1));
+ if(paramVal.Int() != 360)
+ {
+ iEngine->Utils().LogIt(_L("\nCache-Control OTA comparison failed -> [300]"));
+ User::Leave(KErrCorrupt);
+ }
+ THTTPHdrVal hVal2;
+ User::LeaveIfError(hdr.GetField(cacheControl,2,hVal2));
+ if(hVal2.StrF().DesC().Compare(_L8("must-revalidate")) != 0)
+ {
+ iEngine->Utils().LogIt(_L("\nmust-revalidate OTA comparison failed -> [private, max-age=300, must-revalidate]"));
+ User::Leave(KErrCorrupt);
+ }
+
+ TPtrC8 rawHeader;
+ hdr.GetRawField(cacheControl, rawHeader);
+ if(rawHeader.CompareF(KCacheControlOTAVal) != 0)
+ {
+ iEngine->Utils().LogIt(_L("\nmust-revalidate OTA comparison failed -> [300]"));
+ User::Leave(KErrCorrupt);
+ }
+
+ ReleaseHeaders();
+
+ iEngine->Utils().LogIt ( _L ("\nTestDecodeEncodeCacheControlL test success."));
+ }
+
void CHttpHdrCodecTest::TestEncodeAcceptL()
{
// the result we expect and that we will validate
--- a/applayerprotocols/httptransportfw/Test/T_HttpOffline/t_hdrcodec.h Tue Apr 27 17:12:14 2010 +0300
+++ b/applayerprotocols/httptransportfw/Test/T_HttpOffline/t_hdrcodec.h Tue May 11 16:43:01 2010 +0300
@@ -79,6 +79,7 @@
void ResetTimeElapsed();
void DisplayTimeElapsed();
//
+ void TestDecodeEncodeCacheControlL();
void TestEncodeAcceptL();
void TestEncodeAcceptCharsetL();
void TestEncodeAuthorizationL();
--- a/applayerprotocols/httptransportfw/core/CHeaderField.cpp Tue Apr 27 17:12:14 2010 +0300
+++ b/applayerprotocols/httptransportfw/core/CHeaderField.cpp Tue May 11 16:43:01 2010 +0300
@@ -118,7 +118,9 @@
if ((aIndex < NumPartsL()) && (aIndex >= 0))
return iParts[aIndex];
else
- return NULL;
+ User::Leave(KErrNotFound);
+
+ return NULL;
}
EXPORT_C
--- a/applayerprotocols/httptransportfw/core/chttpformencoder.cpp Tue Apr 27 17:12:14 2010 +0300
+++ b/applayerprotocols/httptransportfw/core/chttpformencoder.cpp Tue May 11 16:43:01 2010 +0300
@@ -70,8 +70,8 @@
TInt CHTTPFormEncoder::Reset()
{
- // Not implemented here
- return KErrNotSupported;
+ iState = EAllowAppendData;
+ return KErrNone;
}
EXPORT_C void CHTTPFormEncoder::AddFieldL(const TDesC8& aFieldName, const TDesC8& aFieldValue)
--- a/httpfilters/cookie/ManagerSrc/Cookie.cpp Tue Apr 27 17:12:14 2010 +0300
+++ b/httpfilters/cookie/ManagerSrc/Cookie.cpp Tue May 11 16:43:01 2010 +0300
@@ -531,6 +531,12 @@
{
SetAttribute( EExpires, attributevalue, defaulted );
}
+
+ TTime nowTime;
+ nowTime.UniversalTime();
+ TDateTime attrTime = nowTime.DateTime();
+ THTTPHdrVal attributeVal( attrTime );
+ SetAttribute( EDate, attributeVal, defaulted );
//SetCookie2( aCopyFrom.FromCookie2() );
// Other properties
--- a/httpfilters/httpfiltercommon/src/HttpFilterCommonStringsExt.cpp Tue Apr 27 17:12:14 2010 +0300
+++ b/httpfilters/httpfiltercommon/src/HttpFilterCommonStringsExt.cpp Tue May 11 16:43:01 2010 +0300
@@ -926,6 +926,7 @@
index = EMacedonian;
break;
case ELangMalay: // 70
+ case ELangMalay_Apac: //326
index = EMalay;
break;
case ELangMalayalam: // 71