Example #1
0
        public override void Run(object state)
        {
            try {
                InnerRun(state);
            } catch (Exception e) {
                // FileNotFoundException might be a sign of a bad deployment
                // once we require the .exe and Mono.WebServer in bin or the GAC.

                // IOException, like EndOfStreamException, might be ok.

                if (!(e is EndOfStreamException))
                {
                    Console.Error.WriteLine(e);
                }

                try {
                    // Closing is enough for mod_mono. the module will return a 50x
                    if (Stream != null)
                    {
                        Stream.Close();
                        Stream = null;
                    }
                } catch {}
                if (!server.SingleApplication && broker != null && requestId != -1)
                {
                    broker.UnregisterRequest(requestId);
                    requestId = -1;
                }
            }
        }