From: Dion O. <dol...@us...> - 2005-11-20 20:04:31
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24881/magicajax/Core Modified Files: MagicAjaxModule.cs Util.cs Web.config Log Message: Fingerprints are now configurable (default HashCode, MD5 or FullHtml). Now used for all modes (so not only NoStore). Index: Web.config =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Web.config,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Web.config 18 Nov 2005 10:29:03 -0000 1.3 --- Web.config 20 Nov 2005 20:04:24 -0000 1.4 *************** *** 25,29 **** the maximum number of page objects that can refer to the same page. Default is 5. pageStore/maxPagesLimitAlert - if it's true, an alert box is displayed when the maxConcurrentPages ! limit is reached. Default is false --> <magicAjax> <pageStore --- 25,33 ---- the maximum number of page objects that can refer to the same page. Default is 5. pageStore/maxPagesLimitAlert - if it's true, an alert box is displayed when the maxConcurrentPages ! limit is reached. Default is false ! pageStore/outputCompareMode - "HashCode" : Use String.GetHashCode() to find changed Html output ! "MD5" : Use MD5 hashing to find changed Html output (slower, but practically no collisions) ! "FullHtml" : Use the complete Html output to find changes (for debugging purposes only) ! Default is "HashCode" --> <magicAjax> <pageStore *************** *** 33,36 **** --- 37,41 ---- maxConcurrentPages="5" maxPagesLimitAlert="false" + outputCompareMode="HashCode" /> </magicAjax> Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Util.cs 18 Nov 2005 10:29:03 -0000 1.3 --- Util.cs 20 Nov 2005 20:04:24 -0000 1.4 *************** *** 17,25 **** /// <param name="str"></param> /// <returns></returns> ! static public string GetBase64MD5Sum(string input) { ! byte[] inputBytes = UnicodeEncoding.Default.GetBytes(input); ! byte[] hashedBytes = new MD5CryptoServiceProvider().ComputeHash(inputBytes); ! return Convert.ToBase64String(hashedBytes); } --- 17,40 ---- /// <param name="str"></param> /// <returns></returns> ! static public string GetFingerprint(string input) { ! MagicAjax.Configuration.OutputCompareMode compareMode = MagicAjaxModule.Instance.Configuration.PageStore.CompareMode; ! switch (compareMode) ! { ! case MagicAjax.Configuration.OutputCompareMode.FullHtml: ! return input; ! break; ! case MagicAjax.Configuration.OutputCompareMode.HashCode: ! return input.GetHashCode().ToString("X2"); ! break; ! case MagicAjax.Configuration.OutputCompareMode.MD5: ! byte[] inputBytes = UnicodeEncoding.Default.GetBytes(input); ! byte[] hashedBytes = new MD5CryptoServiceProvider().ComputeHash(inputBytes); ! return Convert.ToBase64String(hashedBytes); ! break; ! default: ! return input; ! break; ! } } Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MagicAjaxModule.cs 20 Nov 2005 08:47:29 -0000 1.18 --- MagicAjaxModule.cs 20 Nov 2005 20:04:24 -0000 1.19 *************** *** 677,684 **** Util.CallPrivateMethod (page, typeof(Page), "SetIntrinsics", _context); - #if NET_2_0 - Util.CallPrivateMethod(page, typeof(Page), "ProcessRequest"); - #endif - ReadOnlyArrayList postDataChangedControls; postDataChangedControls = new ReadOnlyArrayList(LoadFormDataOnChildren(page)); --- 677,680 ---- |