Skip to content
Permalink
Browse files

fixed FramesInCompression/FramesOutCompression computation

  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Sep 9, 2019
1 parent f199b2f commit 1f01e0dff9d5fdf6fd93d7f7a3d29f282a4001c1
Showing with 9 additions and 7 deletions.
  1. +8 −6 SynBidirSock.pas
  2. +1 −1 SynopseCommit.inc
@@ -2057,17 +2057,19 @@ procedure TWebSocketProtocolBinary.ProcessIncomingFrame(Sender: TWebSocketProces
function TWebSocketProtocolBinary.GetFramesInCompression: integer;
begin
if (self=nil) or (fFramesInBytes=0) then
result := 0 else
result := (fFramesInBytesSocket*100) div fFramesInBytes;
result := 100-result;
result := 100 else
if not fCompressed or (fFramesInBytesSocket<fFramesInBytes) then
result := 0 else
result := 100-(fFramesInBytesSocket*100) div fFramesInBytes;
end;

function TWebSocketProtocolBinary.GetFramesOutCompression: integer;
begin
if (self=nil) or (fFramesOutBytes=0) then
result := 0 else
result := (fFramesOutBytesSocket*100) div fFramesOutBytes;
result := 100-result;
result := 100 else
if not fCompressed or (fFramesOutBytesSocket<=fFramesOutBytes) then
result := 0 else
result := 100-(fFramesOutBytesSocket*100) div fFramesOutBytes;
end;

function TWebSocketProtocolBinary.ProcessHandshake(const ExtIn: TRawUTF8DynArray;
@@ -1 +1 @@
'1.18.5333'
'1.18.5334'

0 comments on commit 1f01e0d

Please sign in to comment.
You can’t perform that action at this time.