Explorar el Código

* Patch from Andrew Haines: do not send close connection message if already closed

Michaël Van Canneyt hace 2 años
padre
commit
8133f9ee1e
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      packages/fcl-web/src/websocket/fpwebsocketclient.pp

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

@@ -475,7 +475,7 @@ procedure TCustomWebsocketClient.Disconnect(SendClose : boolean = true);
 begin
   if Not Active then
     Exit;
-  if SendClose then
+  if SendClose and (Connection.CloseState <> csClosed) then
     Connection.Close('');
   if Assigned(MessagePump) then
     MessagePump.RemoveClient(Connection);