Exemplo n.º 1
0
		private void OnFirstRequestStart(HttpContext context) {
			if (_initError != null)
				throw _initError;

			try {
				WebConfigurationSettings.Init (context);
				traceManager = new TraceManager ();
				queueManager = new QueueManager ();
			} catch (Exception e) {
				_initError = e;
			}

			// If we got an error during init, throw to client now..
			if (null != _initError)
				throw _initError;
		}
Exemplo n.º 2
0
		static HttpRuntime ()
		{
			firstRun = true;

			try {
				WebConfigurationManager.Init ();
				SettingsMappingManager.Init ();
				runtime_section = (HttpRuntimeSection) WebConfigurationManager.GetSection ("system.web/httpRuntime");
			} catch (Exception ex) {
				initialException = ex;
			}

			// The classes in whose constructors exceptions may be thrown, should be handled the same way QueueManager
			// and TraceManager are below. The constructors themselves MUST NOT throw any exceptions - we MUST be sure
			// the objects are created here. The exceptions will be dealt with below, in RealProcessRequest.
			queue_manager = new QueueManager ();
			if (queue_manager.HasException) {
				if (initialException == null)
					initialException = queue_manager.InitialException;
				else {
					Console.Error.WriteLine ("Exception during QueueManager initialization:");
					Console.Error.WriteLine (queue_manager.InitialException);
				}
			}

			trace_manager = new TraceManager ();
			if (trace_manager.HasException) {
				if (initialException == null)
					initialException = trace_manager.InitialException;
				else {
					Console.Error.WriteLine ("Exception during TraceManager initialization:");
					Console.Error.WriteLine (trace_manager.InitialException);
				}
			}

			registeredAssemblies = new SplitOrderedList <string, string> (StringComparer.Ordinal);
			cache = new Cache ();
			internalCache = new Cache ();
			internalCache.DependencyCache = internalCache;
			do_RealProcessRequest = new WaitCallback (state => {
				try {
					RealProcessRequest (state);
				} catch {}
				});
			end_of_send_cb = new HttpWorkerRequest.EndOfSendNotification (EndOfSend);
		}
Exemplo n.º 3
0
        static HttpRuntime()
        {
#if !TARGET_J2EE
            firstRun = true;

            try
            {
                WebConfigurationManager.Init();
#if MONOWEB_DEP
                SettingsMappingManager.Init();
#endif
                runtime_section = (HttpRuntimeSection)WebConfigurationManager.GetSection("system.web/httpRuntime");
            }
            catch (Exception ex)
            {
                initialException = ex;
            }

            // The classes in whose constructors exceptions may be thrown, should be handled the same way QueueManager
            // and TraceManager are below. The constructors themselves MUST NOT throw any exceptions - we MUST be sure
            // the objects are created here. The exceptions will be dealt with below, in RealProcessRequest.
            queue_manager = new QueueManager();
            if (queue_manager.HasException)
            {
                if (initialException == null)
                {
                    initialException = queue_manager.InitialException;
                }
                else
                {
                    Console.Error.WriteLine("Exception during QueueManager initialization:");
                    Console.Error.WriteLine(queue_manager.InitialException);
                }
            }

            trace_manager = new TraceManager();
            if (trace_manager.HasException)
            {
                if (initialException == null)
                {
                    initialException = trace_manager.InitialException;
                }
                else
                {
                    Console.Error.WriteLine("Exception during TraceManager initialization:");
                    Console.Error.WriteLine(trace_manager.InitialException);
                }
            }

            cache         = new Cache();
            internalCache = new Cache();
            internalCache.DependencyCache = internalCache;
#endif
            do_RealProcessRequest = new WaitCallback(state =>
            {
                try {
                    RealProcessRequest(state);
                }
                catch {}
            });
            end_of_send_cb = new HttpWorkerRequest.EndOfSendNotification(EndOfSend);
        }
Exemplo n.º 4
0
		private void RenderMenu (TraceManager manager, HtmlTextWriter output, string dir)
		{
			
			output.RenderBeginTag (HtmlTextWriterTag.Html);
			
			output.RenderBeginTag (HtmlTextWriterTag.Head);
			TraceData.RenderStyleSheet (output);
			output.RenderEndTag ();

			RenderHeader (output, dir);
			
			output.RenderBeginTag (HtmlTextWriterTag.Body);
			output.AddAttribute ("class", "tracecontent");
			output.RenderBeginTag (HtmlTextWriterTag.Span);

			Table table = TraceData.CreateTable ();
			
			table.Rows.Add (TraceData.AltRow ("Requests to the Application"));
			table.Rows.Add (TraceData.SubHeadRow ("No", "Time of Request",
							"File", "Status Code", "Verb", "&nbsp;"));

			if (manager.TraceData != null) {
				for (int i=0; i<manager.ItemCount; i++) {
					int item = i + 1;
					TraceData d = manager.TraceData [i];
					TraceData.RenderAltRow (table, i, item.ToString (), d.RequestTime.ToString (),
							d.RequestPath, d.StatusCode.ToString (), d.RequestType,
							"<a href=\"Trace.axd?id=" + item + "\" class=\"tinylink\">" +
							"<b><nobr>View Details</a>");
				}
				table.RenderControl (output);
			}
			
			output.RenderEndTag ();
			output.RenderEndTag ();
			
			output.RenderEndTag ();
		}
Exemplo n.º 5
0
		private void RenderItem (TraceManager manager, HtmlTextWriter output, int item)
		{
			manager.TraceData [item - 1].Render (output);
		}
Exemplo n.º 6
0
        static HttpRuntime()
        {
            PlatformID pid = Environment.OSVersion.Platform;

            runningOnWindows = ((int)pid != 128
#if NET_2_0
                                && pid != PlatformID.Unix && pid != PlatformID.MacOSX
#endif
                                );

            if (runningOnWindows)
            {
                caseInsensitive = true;
                if (AppDomainAppPath != null)
                {
                    isunc = new Uri(AppDomainAppPath).IsUnc;
                }
            }
            else
            {
                string mono_iomap = Environment.GetEnvironmentVariable("MONO_IOMAP");
                if (mono_iomap != null)
                {
                    if (mono_iomap == "all")
                    {
                        caseInsensitive = true;
                    }
                    else
                    {
                        string[] parts = mono_iomap.Split(':');
                        foreach (string p in parts)
                        {
                            if (p == "all" || p == "case")
                            {
                                caseInsensitive = true;
                                break;
                            }
                        }
                    }
                }
            }

            Type monoRuntime = Type.GetType("Mono.Runtime", false);
            monoVersion = null;
            if (monoRuntime != null)
            {
                MethodInfo mi = monoRuntime.GetMethod("GetDisplayName", BindingFlags.Static | BindingFlags.NonPublic);
                if (mi != null)
                {
                    monoVersion = mi.Invoke(null, new object [0]) as string;
                }
            }

            if (monoVersion == null)
            {
                monoVersion = Environment.Version.ToString();
            }

#if !TARGET_J2EE
            firstRun = true;
#if NET_2_0
            try {
                WebConfigurationManager.Init();
#if MONOWEB_DEP
                SettingsMappingManager.Init();
#endif
            } catch (Exception ex) {
                initialException = ex;
            }
#endif

            // The classes in whose constructors exceptions may be thrown, should be handled the same way QueueManager
            // and TraceManager are below. The constructors themselves MUST NOT throw any exceptions - we MUST be sure
            // the objects are created here. The exceptions will be dealt with below, in RealProcessRequest.
            queue_manager = new QueueManager();
            if (queue_manager.HasException)
            {
                initialException = queue_manager.InitialException;
            }

            trace_manager = new TraceManager();
            if (trace_manager.HasException)
            {
                initialException = trace_manager.InitialException;
            }

            cache         = new Cache();
            internalCache = new Cache();
            internalCache.DependencyCache = cache;
#endif
            do_RealProcessRequest = new WaitCallback(RealProcessRequest);
        }