Merge pull request #1568 from wongsyrone/patch-1

Close connection if received zero bytes
This commit is contained in:
Allen Zhu
2017-12-15 06:22:19 -06:00
committed by GitHub
@@ -202,6 +202,7 @@ namespace Shadowsocks.Controller
try
{
int bytesRead = conn.EndReceive(ar);
if (bytesRead <= 0) goto Shutdown;
foreach (IService service in _services)
{
if (service.Handle(buf, bytesRead, conn, null))
@@ -209,6 +210,7 @@ namespace Shadowsocks.Controller
return;
}
}
Shutdown:
// no service found for this
if (conn.ProtocolType == ProtocolType.Tcp)
{