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:
hondacrx
2021-11-15 16:51:25 -05:00
parent 032f9a55f3
commit a9a51d0641
2 changed files with 6 additions and 6 deletions
@@ -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;
+6
View File
@@ -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)