OSDN Git Service

Disable handling of thread exceptions for now unless HANDLE_THREAD_EXCEPTIONS is...
authorLatif Khalifa <latifer@streamgrid.net>
Mon, 5 Oct 2009 09:44:18 +0000 (09:44 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Mon, 5 Oct 2009 09:44:18 +0000 (09:44 +0000)
Increase the throttle to 5 mbps, in preparation of change to libomv throttle limit changes.

git-svn-id: https://radegast.googlecode.com/svn/trunk@301 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/Core/RadegastInstance.cs

index 744e89a..db7b685 100644 (file)
@@ -150,11 +150,12 @@ namespace Radegast
         {\r
             // incase something else calls GlobalInstance while we are loading\r
             globalInstance = this;\r
-#if !DEBUG\r
-            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);\r
+\r
+#if HANDLE_THREAD_EXCEPTIONS\r
+            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);\r
             Application.ThreadException += HandleThreadException;\r
-            AppDomain.CurrentDomain.UnhandledException += HandleUnhandledException;\r
 #endif\r
+\r
             client = client0;\r
 \r
             // Are we running mono?\r
@@ -184,8 +185,7 @@ namespace Radegast
             client.Settings.ASSET_CACHE_DIR = Path.Combine(userDir, "cache");\r
             client.Assets.Cache.AutoPruneEnabled = false;\r
 \r
-            client.Throttle.Texture = 2446000.0f;\r
-            client.Throttle.Asset = 2446000.0f;\r
+            client.Throttle.Total = 5000000f;\r
             client.Settings.THROTTLE_OUTGOING_PACKETS = true;\r
             client.Settings.LOGIN_TIMEOUT = 120 * 1000;\r
             client.Settings.SIMULATOR_TIMEOUT = 120 * 1000;\r
@@ -552,14 +552,13 @@ namespace Radegast
 \r
         public void HandleThreadException(object sender, ThreadExceptionEventArgs e)\r
         {\r
-            Console.WriteLine("" + e.Exception);\r
-            Logger.Log("Unhandled Thread Exception: " + e.Exception + " in " + sender, Helpers.LogLevel.Error, client);\r
-        }\r
+            Logger.Log("Unhandled Thread Exception: " \r
+                + e.Exception.Message + Environment.NewLine\r
+                + e.Exception.StackTrace + Environment.NewLine,\r
+                Helpers.LogLevel.Error,\r
+                client);\r
 \r
-        private void HandleUnhandledException(object sender, UnhandledExceptionEventArgs e)\r
-        {\r
-            Console.WriteLine("" + e.ExceptionObject);\r
-            Logger.Log("Unhandled Exception: " + e.ExceptionObject + " in " + sender, Helpers.LogLevel.Error, client);\r
+            Application.Exit();\r
         }\r
     }\r
 }\r