Browse Source

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

Yuri Silver 3 years ago
parent
commit
4e51973dba
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/fcl-web/src/websocket/fpwebsocket.pp

+ 1 - 1
packages/fcl-web/src/websocket/fpwebsocket.pp

@@ -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);