# HG changeset patch # User moel.mich # Date 1272222315 0 # Node ID 4775bffe617368b1bbaf33cb1bc579d6a115ffe6 # Parent 1a2d7dad320e4f7584f5f3120a8a68dad21cb329 Improved the stability of the crash reporting system. diff -r 1a2d7dad320e -r 4775bffe6173 GUI/CrashReportForm.cs --- a/GUI/CrashReportForm.cs Sun Apr 25 14:40:19 2010 +0000 +++ b/GUI/CrashReportForm.cs Sun Apr 25 19:05:15 2010 +0000 @@ -79,7 +79,7 @@ WebRequest request = WebRequest.Create( "http://openhardwaremonitor.org/report.php"); request.Method = "POST"; - request.Timeout = 3000; + request.Timeout = 5000; request.ContentType = "application/x-www-form-urlencoded"; string report = @@ -89,10 +89,11 @@ byte[] byteArray = Encoding.UTF8.GetBytes(report); request.ContentLength = byteArray.Length; - Stream dataStream = request.GetRequestStream(); - dataStream.Write(byteArray, 0, byteArray.Length); - dataStream.Close(); try { + Stream dataStream = request.GetRequestStream(); + dataStream.Write(byteArray, 0, byteArray.Length); + dataStream.Close(); + WebResponse response = request.GetResponse(); dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); @@ -100,10 +101,13 @@ reader.Close(); dataStream.Close(); response.Close(); + + Close(); } catch (WebException) { + MessageBox.Show("Sending the crash report failed.", "Error", + MessageBoxButtons.OK, MessageBoxIcon.Error); } - } finally { - Close(); + } catch { } } } diff -r 1a2d7dad320e -r 4775bffe6173 Program.cs --- a/Program.cs Sun Apr 25 14:40:19 2010 +0000 +++ b/Program.cs Sun Apr 25 19:05:15 2010 +0000 @@ -91,7 +91,10 @@ Exception e = args.ExceptionObject as Exception; if (e != null) ReportException(e); - } catch { } + } catch { + } finally { + Environment.Exit(0); + } } } } diff -r 1a2d7dad320e -r 4775bffe6173 Properties/AssemblyInfo.cs --- a/Properties/AssemblyInfo.cs Sun Apr 25 14:40:19 2010 +0000 +++ b/Properties/AssemblyInfo.cs Sun Apr 25 19:05:15 2010 +0000 @@ -69,5 +69,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.30.0")] -[assembly: AssemblyFileVersion("0.1.30.0")] +[assembly: AssemblyVersion("0.1.31.0")] +[assembly: AssemblyFileVersion("0.1.31.0")]