From ff2133b14cf68fbc25456e108d393db41ec9bf2f Mon Sep 17 00:00:00 2001 From: Koray Koska <11356621+koraykoska@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:58:39 +0200 Subject: [PATCH] fix: count increase --- Sources/libwebsockets/WebsocketFrameSequence.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/libwebsockets/WebsocketFrameSequence.swift b/Sources/libwebsockets/WebsocketFrameSequence.swift index 28c1583..bd7259f 100644 --- a/Sources/libwebsockets/WebsocketFrameSequence.swift +++ b/Sources/libwebsockets/WebsocketFrameSequence.swift @@ -43,15 +43,15 @@ public struct WebsocketSimpleAppendFrameSequence: WebsocketFrameSequence { _binaryBuffer.append(Data(count: max(bufferSize, frame.count))) } - _count += frame.count self._binaryBuffer.insert(contentsOf: frame, at: _count) + _count += frame.count case .text: if _textBuffer.count < _count + frame.count { _textBuffer.append(Data(count: max(bufferSize, frame.count))) } - _count += frame.count self._textBuffer.insert(contentsOf: frame, at: _count) + _count += frame.count default: break }