// Token: 0x06000155 RID: 341 RVA: 0x0000A68C File Offset: 0x0000888C internal static void LogTimeInLiveIdModule(HttpContext httpContext) { if (!LogonLatencyLogger.loggingEnabled) { return; } try { DateTime?dateTime = httpContext.Items["RequestStartTime"] as DateTime?; if (dateTime != null && dateTime != null) { DateTime utcNow = DateTime.UtcNow; long latency = Convert.ToInt64((utcNow - dateTime.Value).TotalMilliseconds); long latency2 = -1L; DateTime?dateTime2 = httpContext.Items["AdRequestStartTime"] as DateTime?; DateTime?dateTime3 = httpContext.Items["AdRequestEndTime"] as DateTime?; if (dateTime2 != null && dateTime2 != null && dateTime3 != null && dateTime3 != null) { latency2 = Convert.ToInt64((dateTime3.Value - dateTime2.Value).TotalMilliseconds); } httpContext.Response.AppendToLog(string.Format("&lvidmdlltncy={0}&lvidadlookupltncy={1}", latency.ToString(), latency2.ToString())); LogonLatencyLogger.AddLatencyHeader(httpContext, "X-AuthDiagInfoLiveIdModuleLatency", latency); LogonLatencyLogger.AddLatencyHeader(httpContext, "X-AuthDiagInfoLiveIdModuleAdLookupLatency", latency2); httpContext.Items["RequestStartTime"] = null; } } catch (Exception arg) { ExTraceGlobals.PerformanceTracer.TraceDebug <Exception>(0L, "Exception happened while trying to Log Time In LiveIdModule. Exception will be ignored: {0}", arg); } }
// Token: 0x06000151 RID: 337 RVA: 0x0000A1A0 File Offset: 0x000083A0 internal static void UpdateCookie(HttpContext httpContext, string action, DateTime checkPointDateTime) { try { if (LogonLatencyLogger.loggingEnabled) { DateTime utcNow = DateTime.UtcNow; long latency = Convert.ToInt64((utcNow - checkPointDateTime).TotalMilliseconds); if (action.Equals("ADL")) { LogonLatencyLogger.AddLatencyHeader(httpContext, "X-AuthDiagInfoLdapLatency", latency); } else { LogonLatencyLogger.AddLatencyHeader(httpContext, "X-AuthDiagInfoMservLookupLatency", latency); } string text = string.Empty; string cookieValue = string.Empty; if (httpContext.Request.Cookies["logonLatency"] != null && httpContext.Request.Cookies["logonLatency"].Value != null) { text = LogonLatencyLogger.GetLatestCookieValue(httpContext); if (action.Equals("ADL") || action.Equals("MSERVL")) { int num = 1; if (!string.IsNullOrEmpty(text)) { while (text.Contains(action + num)) { num++; } } action += num; } cookieValue = string.Format("{0}&{1}={2}", text, action, latency.ToString()); LogonLatencyLogger.SetCookie(httpContext, "logonLatency", cookieValue, Utilities.GetOutlookDotComDomain(httpContext.Request.GetRequestUrlEvenIfProxied().Host)); } else { string arg = "adlkupltncy"; if (action.Equals("MSERVL")) { arg = "mservlkupltncy"; } httpContext.Response.AppendToLog(string.Format("&{0}={1}", arg, latency.ToString())); } } } catch (Exception ex) { ExTraceGlobals.LiveIdAuthenticationModuleTracer.TraceError <string, string>(0L, "Unexpected exception while updating logon latency cookie. Exception message: {0}. Stack trace: {1}", ex.Message, ex.StackTrace); } }