Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen C. Wills <swills@gridprotectionalliance.org>2017-10-11 20:36:37 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2017-10-11 20:36:37 +0300
commit03474ba9e243afde7f2c2f2129207d7fb8829452 (patch)
treeb80f50e0862b277aa4ccae29bda8bfc9c1a4da91 /mcs/class/System
parentabd4a6a57b5285ef7b44f37c1be1989cb72ec602 (diff)
Fixed unhandled exceptions in EndPointListener.cs (#5724)
Application hosting self-hosted website over https crashes when attempting to access a webpage over http. The patch described in the bug report below resolves the crash, and the commit in this pull request implements the fix. https://bugzilla.xamarin.com/show_bug.cgi?id=52675
Diffstat (limited to 'mcs/class/System')
-rw-r--r--mcs/class/System/System.Net/EndPointListener.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/mcs/class/System/System.Net/EndPointListener.cs b/mcs/class/System/System.Net/EndPointListener.cs
index 58aa63ea062..61b8bbd025b 100644
--- a/mcs/class/System/System.Net/EndPointListener.cs
+++ b/mcs/class/System/System.Net/EndPointListener.cs
@@ -112,7 +112,13 @@ namespace System.Net {
accepted.Close ();
return;
}
- HttpConnection conn = new HttpConnection (accepted, epl, epl.secure, epl.cert);
+ HttpConnection conn;
+ try {
+ conn = new HttpConnection (accepted, epl, epl.secure, epl.cert);
+ } catch {
+ accepted.Close ();
+ return;
+ }
lock (epl.unregistered) {
epl.unregistered [conn] = conn;
}