Browse Source

Close connection if received zero bytes

This might fix 500 Privoxy Internal Error: no-server-data
tags/4.0.8
Syrone Wong GitHub 7 years ago
parent
commit
218925e191
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 try
{ {
int bytesRead = conn.EndReceive(ar); int bytesRead = conn.EndReceive(ar);
if (bytesRead <= 0) goto Shutdown;
foreach (IService service in _services) foreach (IService service in _services)
{ {
if (service.Handle(buf, bytesRead, conn, null)) if (service.Handle(buf, bytesRead, conn, null))
@@ -209,6 +210,7 @@ namespace Shadowsocks.Controller
return; return;
} }
} }
Shutdown:
// no service found for this // no service found for this
if (conn.ProtocolType == ProtocolType.Tcp) if (conn.ProtocolType == ProtocolType.Tcp)
{ {


Loading…
Cancel
Save