Пример #1
0
        // Token: 0x0600028B RID: 651 RVA: 0x00011B78 File Offset: 0x0000FD78
        private static void OnPostAuth(object source, EventArgs args)
        {
            HttpApplication httpApplication = (HttpApplication)source;
            HttpContext     context         = httpApplication.Context;
            HttpRequest     request         = context.Request;

            if (request.IsAuthenticated && request.LogonUserIdentity.AuthenticationType == "Basic" && request.LogonUserIdentity.IsAuthenticated)
            {
                WindowsIdentity windowsIdentity = new WindowsIdentity(context.Request.LogonUserIdentity.Token, "Negotiate", WindowsAccountType.Normal);
                try
                {
                    FaultInjection.GenerateFault((FaultInjection.LIDs) 4154862909U);
                    context.User = new WindowsPrincipal(windowsIdentity);
                }
                catch (SystemException ex)
                {
                    string safeName = context.Request.LogonUserIdentity.GetSafeName(true);
                    ExTraceGlobals.FrameworkTracer.TraceError <string, SystemException>(0L, "Exception thrown constructing WindowsPrincipal for user {0}. Exception {1}", safeName, ex);
                    Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_ErrWebException, Common.PeriodicKey, new object[]
                    {
                        ex.Message,
                        ex.StackTrace
                    });
                    windowsIdentity.Dispose();
                }
            }
        }
        protected override void AddToQueryList(UserResultMapping userResultMapping, IBudget budget)
        {
            FaultInjection.GenerateFault((FaultInjection.LIDs) 2745576765U);
            OrganizationId organizationId;

            if (base.TryGetOrganizationId(userResultMapping, out organizationId))
            {
                base.AddToADQueryList(userResultMapping, organizationId, null, budget);
                return;
            }
            this.AddToMServeQueryList(userResultMapping);
        }
Пример #3
0
        protected override bool InternalExecute()
        {
            if (this.datapoints == null || this.datapoints.Length == 0)
            {
                return(true);
            }
            InstrumentationSettings instrumentationSettings = this.GetInstrumentationSettings();

            if (!instrumentationSettings.IsInstrumentationEnabled())
            {
                return(true);
            }
            UserContext userContext          = this.GetUserContext();
            Stopwatch   stopwatch            = Stopwatch.StartNew();
            Datapoint   chunkHeaderDatapoint = this.GetChunkHeaderDatapoint(this.datapoints[0].Time);
            int         num;
            IDictionary <DatapointConsumer, LogDatapoint.ClientLogEventList> dictionary = this.TriageAndConvertDatapoints(userContext, chunkHeaderDatapoint, instrumentationSettings, out num);
            long elapsedMilliseconds      = stopwatch.ElapsedMilliseconds;
            IList <ClientLogEvent> events = dictionary[DatapointConsumer.Watson].Events;

            if (events.Count > 0 && instrumentationSettings.IsClientWatsonEnabled)
            {
                this.clientWatsonHandler.ReportWatsonEvents(userContext, events, chunkHeaderDatapoint, this.datapoints);
            }
            FaultInjection.GenerateFault((FaultInjection.LIDs) 3804638525U);
            stopwatch.Restart();
            this.analyticsLogger(dictionary[DatapointConsumer.Analytics].Events);
            this.diagnosticsLogger(dictionary[DatapointConsumer.Diagnostics].Events);
            long elapsedMilliseconds2 = stopwatch.ElapsedMilliseconds;
            long num2 = 0L;
            long num3 = 0L;
            int  num4 = 0;

            if (this.isOwa && dictionary[DatapointConsumer.Inference].Events.Count > 0)
            {
                stopwatch.Restart();
                IActivityLogger activityLogger = this.GetActivityLogger();
                if (activityLogger != null)
                {
                    IList <Activity> list = this.CreateInferenceActivities(dictionary[DatapointConsumer.Inference].Events);
                    num2 = stopwatch.ElapsedMilliseconds;
                    num3 = 0L;
                    if (list.Count > 0)
                    {
                        num4 = list.Count;
                        stopwatch.Restart();
                        this.WriteInferenceActivities(list, activityLogger);
                        num3 = stopwatch.ElapsedMilliseconds;
                    }
                }
            }
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.CreateDatapointEventsElapsed, elapsedMilliseconds);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.TotalDatapointSize, num);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.AnalyticsDatapointCount, dictionary[DatapointConsumer.Analytics].Events.Count);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.AnalyticsDatapointSize, dictionary[DatapointConsumer.Analytics].DatapointTotalSize);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.InferenceDatapointCount, dictionary[DatapointConsumer.Inference].Events.Count);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.InferenceDatapointSize, dictionary[DatapointConsumer.Inference].DatapointTotalSize);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.DiagnosticsDatapointCount, dictionary[DatapointConsumer.Diagnostics].Events.Count);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.DiagnosticsDatapointSize, dictionary[DatapointConsumer.Diagnostics].DatapointTotalSize);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.WatsonDatapointCount, dictionary[DatapointConsumer.Watson].Events.Count);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.WatsonDatapointSize, dictionary[DatapointConsumer.Watson].DatapointTotalSize);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.DatapointsToLoggerElapsed, elapsedMilliseconds2);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.InferenceActivitiesToMailboxCount, num4);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.CreateInferenceActivitiesElapsed, num2);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.InferenceActivitiesToMailboxElapsed, num3);
            return(true);
        }
Пример #4
0
        // Token: 0x060002D5 RID: 725 RVA: 0x00012C14 File Offset: 0x00010E14
        protected override void OnWriteBodyContents(XmlDictionaryWriter dictionaryXml)
        {
            bool error = true;
            XmlWriterSettings xmlWriterSettings = new XmlWriterSettings();

            xmlWriterSettings.Indent           = true;
            xmlWriterSettings.IndentChars      = "  ";
            xmlWriterSettings.ConformanceLevel = ConformanceLevel.Document;
            XmlWriter xmlWriter  = XmlWriter.Create(dictionaryXml, new XmlWriterSettings());
            string    callerInfo = "LegacyBodyWriter.OnWriteBodyContents";

            if (!this.parseSuccess)
            {
                ExTraceGlobals.FrameworkTracer.TraceError <string>((long)this.GetHashCode(), "[OnWriteBodyContents()] 'Validation failed. Provider \"{0}\"'", base.GetType().AssemblyQualifiedName);
                Common.GenerateErrorResponse(xmlWriter, "http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006", "600", Strings.InvalidRequest.ToString(), this.debugData, this.requestData, base.GetType().AssemblyQualifiedName);
            }
            else
            {
                IStandardBudget standardBudget = null;
                try
                {
                    FaultInjection.GenerateFault((FaultInjection.LIDs) 2917543229U);
                    standardBudget = StandardBudget.Acquire(this.requestData.User.Identity.GetSecurityIdentifier(), BudgetType.Ews, Common.GetSessionSettingsForCallerScope());
                    HttpContext.Current.Items["StartBudget"] = standardBudget.ToString();
                    standardBudget.CheckOverBudget();
                    standardBudget.StartConnection(callerInfo);
                    standardBudget.StartLocal(callerInfo, default(TimeSpan));
                    string text;
                    error = this.GenerateResponse(xmlWriter, standardBudget, out text);
                    HttpContext.Current.Items["EndBudget"] = standardBudget.ToString();
                    if (!string.IsNullOrEmpty(text))
                    {
                        HttpContext.Current.Response.Redirect(text, false);
                    }
                }
                catch (OverBudgetException)
                {
                    this.TraceExceptionAndGenerateErrorResponse(xmlWriter, Strings.ServerBusy.ToString(), "[OnWriteBodyContents()] 'Account has exceeded budget.");
                }
                catch (NonUniqueRecipientException ex)
                {
                    this.TraceExceptionAndGenerateErrorResponse(xmlWriter, Strings.ADUnavailable.ToString(), "[OnWriteBodyContents()] " + ex.Message);
                }
                catch (ADTransientException ex2)
                {
                    this.TraceExceptionAndGenerateErrorResponse(xmlWriter, Strings.ADUnavailable.ToString(), "[OnWriteBodyContents()] " + ex2.Message);
                }
                finally
                {
                    if (standardBudget != null)
                    {
                        try
                        {
                            FaultInjection.GenerateFault((FaultInjection.LIDs) 4081462589U);
                            standardBudget.Dispose();
                        }
                        catch (ADTransientException arg)
                        {
                            ExTraceGlobals.FrameworkTracer.TraceError <ADTransientException>((long)this.GetHashCode(), "[OnWriteBodyContents()] Got ADTransientException {0} while disposing budget.", arg);
                        }
                        standardBudget = null;
                    }
                }
            }
            PerformanceCounters.UpdateTotalRequests(error);
            RequestDetailsLoggerBase <RequestDetailsLogger> .Current.ActivityScope.Action = "POX";
        }