Fixes a crash when trying to login with wrong version launcher or no launcher. Caused bnetserver to enter a infinite loop.
This commit is contained in:
@@ -25,12 +25,6 @@ namespace BNetServer.Networking
|
||||
|
||||
public async override void ReadHandler(byte[] data, int receivedLength)
|
||||
{
|
||||
if (receivedLength == 0)
|
||||
{
|
||||
CloseSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
var httpRequest = HttpHelper.ParseRequest(data, receivedLength);
|
||||
if (httpRequest == null)
|
||||
return;
|
||||
|
||||
@@ -67,6 +67,12 @@ namespace Framework.Networking
|
||||
try
|
||||
{
|
||||
var result = await _stream.ReadAsync(_receiveBuffer, 0, _receiveBuffer.Length);
|
||||
if (result == 0)
|
||||
{
|
||||
CloseSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
ReadHandler(_receiveBuffer, result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user