Close connection if received zero bytes

This might fix 500 Privoxy Internal Error: no-server-data
This commit is contained in:
Syrone Wong
2017-12-14 09:54:31 +08:00
committed by GitHub
parent 0c877a76c6
commit 218925e191
@@ -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)
{