Browse Source

Merge pull request #1568 from wongsyrone/patch-1

Close connection if received zero bytes
tags/4.0.8
Allen Zhu GitHub 7 years ago
parent
commit
f7cd2390b2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      shadowsocks-csharp/Controller/Service/Listener.cs

+ 2
- 0
shadowsocks-csharp/Controller/Service/Listener.cs View File

@@ -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)
{


Loading…
Cancel
Save