mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-29 05:18:14 +00:00
Improved the stability of the crash reporting system.
This commit is contained in:
parent
426938de54
commit
98c7c31cac
@ -79,7 +79,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
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 @@ namespace OpenHardwareMonitor.GUI {
|
||||
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 @@ namespace OpenHardwareMonitor.GUI {
|
||||
reader.Close();
|
||||
dataStream.Close();
|
||||
response.Close();
|
||||
|
||||
Close();
|
||||
} catch (WebException) {
|
||||
MessageBox.Show("Sending the crash report failed.", "Error",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
} finally {
|
||||
Close();
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,10 @@ namespace OpenHardwareMonitor {
|
||||
Exception e = args.ExceptionObject as Exception;
|
||||
if (e != null)
|
||||
ReportException(e);
|
||||
} catch { }
|
||||
} catch {
|
||||
} finally {
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
|
||||
// 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")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user