Browse Source

Fix a null ref exception.

At that time the remote even doesn't exist.
Also this debug output doesn't make any sense because when handling
udp request, this tcp connection won't have any meaningful data.
So I simply removed these two lines.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
tags/3.3
noisyfox 8 years ago
parent
commit
6cb58b229d
1 changed files with 0 additions and 2 deletions
  1. +0
    -2
      shadowsocks-csharp/Controller/Service/TCPRelay.cs

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

@@ -303,7 +303,6 @@ namespace Shadowsocks.Controller
if (ar.AsyncState != null)
{
connection.EndSend(ar);
Logging.Debug(remote.LocalEndPoint, remote.DestEndPoint, RecvSize, "TCP Relay");
connection.BeginReceive(_connetionRecvBuffer, 0, RecvSize, SocketFlags.None, new AsyncCallback(ReadAll), null);
}
else
@@ -311,7 +310,6 @@ namespace Shadowsocks.Controller
int bytesRead = connection.EndReceive(ar);
if (bytesRead > 0)
{
Logging.Debug(remote.LocalEndPoint, remote.DestEndPoint, RecvSize, "TCP Relay");
connection.BeginReceive(_connetionRecvBuffer, 0, RecvSize, SocketFlags.None, new AsyncCallback(ReadAll), null);
}
else


Loading…
Cancel
Save