Răsfoiți Sursa

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

Michaël Van Canneyt 3 ani în urmă
părinte
comite
8133f9ee1e
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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
 begin
   if Not Active then
   if Not Active then
     Exit;
     Exit;
-  if SendClose then
+  if SendClose and (Connection.CloseState <> csClosed) then
     Connection.Close('');
     Connection.Close('');
   if Assigned(MessagePump) then
   if Assigned(MessagePump) then
     MessagePump.RemoveClient(Connection);
     MessagePump.RemoveClient(Connection);