From dfe82ed9808d2521a7e961c122a7c4c7c1ce880e Mon Sep 17 00:00:00 2001 From: Jimmy Hough Jr Date: Wed, 30 Aug 2023 09:01:31 -0500 Subject: [PATCH] wip review --- Sources/WebSocketKit/PMCE.swift | 2 +- Sources/WebSocketKit/WebSocket.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/WebSocketKit/PMCE.swift b/Sources/WebSocketKit/PMCE.swift index ad6e9e52..8fc2cc28 100644 --- a/Sources/WebSocketKit/PMCE.swift +++ b/Sources/WebSocketKit/PMCE.swift @@ -389,7 +389,7 @@ public final class PMCE: Sendable { data: compressed) frame.rsv1 = true - let slice = compressed.getSlice(at:compressed.readerIndex, + let slice = compressed.getSlice(at: compressed.readerIndex, length: compressed.readableBytes - 4) frame.data = slice ?? compressed diff --git a/Sources/WebSocketKit/WebSocket.swift b/Sources/WebSocketKit/WebSocket.swift index 3fa7e63c..9dc9c860 100644 --- a/Sources/WebSocketKit/WebSocket.swift +++ b/Sources/WebSocketKit/WebSocket.swift @@ -226,7 +226,7 @@ public final class WebSocket: Sendable { self.channel.writeAndFlush(compressedFrame, promise: promise) } catch { - logger.error("\(error)") + promise?.fail(error) } } else {