mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-28 21:07:47 +00:00
Added additional exception handling to the http server.
This commit is contained in:
parent
0bc6629e3a
commit
dcfa8ef3f9
@ -10,5 +10,5 @@
|
|||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("0.5.1.14")]
|
[assembly: AssemblyVersion("0.5.1.15")]
|
||||||
[assembly: AssemblyInformationalVersion("0.5.1.14 Alpha")]
|
[assembly: AssemblyInformationalVersion("0.5.1.15 Alpha")]
|
@ -5,7 +5,7 @@
|
|||||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
Copyright (C) 2012 Prince Samuel <prince.samuel@gmail.com>
|
Copyright (C) 2012 Prince Samuel <prince.samuel@gmail.com>
|
||||||
Copyright (C) 2012 Michael Möller <mmoeller@openhardwaremonitor.org>
|
Copyright (C) 2012-2013 Michael Möller <mmoeller@openhardwaremonitor.org>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -37,6 +37,7 @@ namespace OpenHardwareMonitor.Utilities {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
listener = new HttpListener();
|
listener = new HttpListener();
|
||||||
|
listener.IgnoreWriteExceptions = true;
|
||||||
} catch (PlatformNotSupportedException) {
|
} catch (PlatformNotSupportedException) {
|
||||||
listener = null;
|
listener = null;
|
||||||
}
|
}
|
||||||
@ -156,10 +157,12 @@ namespace OpenHardwareMonitor.Utilities {
|
|||||||
while ((len = stream.Read(buffer, 0, buffer.Length)) > 0) {
|
while ((len = stream.Read(buffer, 0, buffer.Length)) > 0) {
|
||||||
output.Write(buffer, 0, len);
|
output.Write(buffer, 0, len);
|
||||||
}
|
}
|
||||||
|
output.Flush();
|
||||||
output.Close();
|
output.Close();
|
||||||
} catch (HttpListenerException) {
|
|
||||||
}
|
|
||||||
response.Close();
|
response.Close();
|
||||||
|
} catch (HttpListenerException) {
|
||||||
|
} catch (InvalidOperationException) {
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user