private void sinkResults(TheRequestData resBytes) { TheBaseAssets.MySYSLOG.WriteToLog(400, TSM.L(eDEBUG_LEVELS.VERBOSE) ? null : new TSM(MyBaseEngine.GetEngineName(), string.Format("Result Bytes:{1} with Cookie:{2} For Page:{0} Sent", resBytes.cdeRealPage, resBytes.ResponseBuffer != null ? resBytes.ResponseBuffer.Length : 0, resBytes.CookieString), eMsgLevel.l4_Message)); if (!string.IsNullOrEmpty(resBytes.CookieString)) { string[] tCookies = resBytes.CookieString.Split(';'); if (ReqBuffer.ContainsID(TheCommonUtils.CGuid(tCookies[tCookies.Length - 1]))) { if (tCookies.Length > 1) { resBytes.CookieString = ""; for (int i = 0; i < tCookies.Length - 1; i++) { if (resBytes.CookieString.Length > 0) { resBytes.CookieString += ";"; } resBytes.CookieString += tCookies[i]; } } if (resBytes.ResponseBuffer == null && !string.IsNullOrEmpty(resBytes.ErrorDescription)) { resBytes.ResponseBuffer = TheCommonUtils.CUTF8String2Array(resBytes.ErrorDescription); } //TODO: HackProcessing - Advanced Hack Table: Replace X with Y //Console.WriteLine("SR:" + resBytes.cdeRealPage.ToLower()); /* * if (resBytes.cdeRealPage.ToLower().StartsWith("/js/default.js")) * { * string t = TheCommonUtils.CArray2UTF8String(resBytes.ResponseBuffer); * //var checkLocal = document.URL replace with return true; //TODO: Hack List * if (t.IndexOf("var checkLocal=document.URL;") >= 0) * t = t.Replace("var checkLocal=document.URL;", "return true;"); * //if (t.IndexOf("return _.isObject(user)&&user.isLogin()") >= 0) * // t = t.Replace("return _.isObject(user)&&user.isLogin()", "return true;"); * t = t.Replace("window.location.hostname", "window.location.hostname+':'+window.location.port"); * resBytes.ResponseBuffer = TheCommonUtils.CUTF8String2Array(t); * }*/ ReqBuffer.AddOrUpdateItem(TheCommonUtils.CGuid(tCookies[tCookies.Length - 1]), resBytes, null); } else { TheBaseAssets.MySYSLOG.WriteToLog(400, TSM.L(eDEBUG_LEVELS.ESSENTIALS) ? null : new TSM(MyBaseEngine.GetEngineName(), string.Format("Result Bytes For Page:{0} NoLonger in ReqBuffer", resBytes.cdeRealPage), eMsgLevel.l2_Warning)); } } }