Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Catch exception thrown by HttpConnection constructor and close connection #33190

Merged
merged 2 commits into from
Nov 2, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,16 @@ private static void ProcessAccept(SocketAsyncEventArgs args)
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._unregisteredConnections)
{
epl._unregisteredConnections[conn] = conn;
Expand Down