In case of incorrect shutdown of the client. The buffer may return =0. There will be an exception.

This commit is contained in:
Yuri Silver 2022-02-01 22:36:16 +03:00
parent 6faa3872fc
commit 4e51973dba

View File

@ -645,7 +645,7 @@ begin
repeat
SetLength(buf, aCount);
Result := FSocket.ReadData(buf, aCount - aPos);
if Result = -1 then
if Result <= 0 then
break;
SetLength(buf, Result);
Move(buf[0], aBytes[aPos], Result);