// Token: 0x06001158 RID: 4440 RVA: 0x000426A0 File Offset: 0x000408A0
        internal override void Initialize()
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            ExTraceGlobals.ConfigurationManagerTracer.TraceDebug(0L, "OwaApplication.Initialize: SafeHtml loading begin");
            IntPtr value = NativeMethods.LoadLibrary(Path.GetFullPath(Path.Combine(ExchangeSetupContext.BinPath, "SafeHtmlNativeWrapper.dll")));

            if (value == IntPtr.Zero)
            {
                ExTraceGlobals.ConfigurationManagerTracer.TraceError(0L, "OwaApplication.Initialize: Failed to load SafeHtmlNativeWrapper.");
                Global.SafeHtmlLoaded = false;
            }
            else
            {
                ExTraceGlobals.ConfigurationManagerTracer.TraceDebug(0L, "OwaApplication.Initialize: SafeHtmlNativeWrapper loaded successfully.");
                Global.SafeHtmlLoaded = true;
            }
            SafeHtml.Initialize(ExchangeSetupContext.BinPath + Path.DirectorySeparatorChar);
            ExTraceGlobals.ConfigurationManagerTracer.TraceDebug(0L, "OwaApplication.Initialize: SafeHtml loading finished");
            Global.InitializeSettingsFromWebConfig();
            int workerThreads;
            int num;

            ThreadPool.GetMinThreads(out workerThreads, out num);
            int configIntValue = AppConfigLoader.GetConfigIntValue("ThreadPoolMinIOCPThreads", 0, int.MaxValue, 3 * Environment.ProcessorCount);

            ThreadPool.SetMinThreads(workerThreads, configIntValue);
            OwaApplication.InitializeApplicationCaches();
            RequestDetailsLogger.ApplicationType = LoggerApplicationType.Owa;
            OwaClientLogger.Initialize();
            OwaClientTraceLogger.Initialize();
            OwaServerLogger.Initialize();
            OwaServerTraceLogger.Initialize();
            SettingOverrideSync.Instance.Start(true);
            LoggerSettings.MaxAppendableColumnLength   = null;
            LoggerSettings.ErrorMessageLengthThreshold = null;
            Global.ResponseShapeResolver = new OwaResponseShapeResolver();
            Global.EwsClientMailboxSessionCloningHandler = new EwsClientMailboxSessionCloningHandler(UserContextManager.GetClonedMailboxSession);
            Global.DefaultMapiClientType             = "Client=OWA";
            MailboxSession.DefaultFoldersToForceInit = OwaApplication.foldersToForceInitialize;
            UserContextManager.Initialize();
            if (Globals.OwaIsNoRecycleEnabled)
            {
                OwaVersionId.InitializeOwaVersionReadingTimer();
            }
            KillBitTimer.Singleton.Start();
            KillbitWatcher.TryWatch(new KillbitWatcher.ReadKillBitFromFileCallback(KillBitHelper.ReadKillBitFromFile));
            OwaServerLogger.AppendToLog(new OwaAppStartLogEvent((double)stopwatch.ElapsedMilliseconds));
        }
示例#2
0
        internal static void InternalCheckClientVersion(CallContext callContext, Func <string, string> headerGetter)
        {
            if (EsoRequest.IsEsoRequest(callContext.HttpContext.Request))
            {
                return;
            }
            string      text = headerGetter("X-OWA-VersionId");
            string      clientOwsVersionString = headerGetter("X-OWA-ClientOWSVersion");
            UserContext userContext            = UserContextManager.GetMailboxContext(HttpContext.Current, null, true) as UserContext;
            bool        flag = userContext != null && userContext.FeaturesManager.ServerSettings.OwaVNext.Enabled;
            bool        flag2;

            if (userContext != null && userContext.FeaturesManager.ClientServerSettings.OwaVersioning.Enabled)
            {
                flag2 = OwaVersionId.Supports(clientOwsVersionString, flag);
            }
            else
            {
                flag2 = OwaVersionId.Matches(text, flag);
            }
            if (flag2)
            {
                return;
            }
            string arg      = flag ? OwaVersionId.VNext : OwaVersionId.Current;
            string text2    = string.Format("Server={0}, Client={1}", arg, text);
            string actionId = headerGetter("X-OWA-ActionId");

            if (CallContext.IsQueuedActionId(actionId))
            {
                Microsoft.Exchange.Diagnostics.Components.Services.ExTraceGlobals.CommonAlgorithmTracer.TraceDebug <string>(0L, "[OWAMessageInspector::CheckClientVersion] Ignoring version mismatch because this is a queued action {0}", text2);
                return;
            }
            Microsoft.Exchange.Diagnostics.Components.Services.ExTraceGlobals.CommonAlgorithmTracer.TraceWarning <string>(0L, "[OWAMessageInspector::CheckClientVersion] Client/Server version mismatch: {0}", text2);
            throw new OwaVersionException(text2, callContext.GetEffectiveAccessingSmtpAddress());
        }
示例#3
0
 // Token: 0x06001412 RID: 5138 RVA: 0x000484BB File Offset: 0x000466BB
 private static void UpdateCurrentOwaVersion(object source, ElapsedEventArgs e)
 {
     OwaRegistryKeys.UpdateOwaSetupVersionsCache();
     OwaVersionId.current = OwaVersionId.GetInstalledOwaVersion();
     OwaVersionId.vNext   = OwaVersionId.GetInstalledNextOwaVersion();
 }