Skip to content

Commit

Permalink
wip review
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoughjr committed Aug 29, 2023
1 parent db363b2 commit cd7e448
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions Sources/WebSocketKit/WebSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,8 @@ public final class WebSocket: Sendable {
) {
if let p = pmce,
p.enabled {
do {
let compressedFrame = try p.compressed(data, fin:fin, opCode: opcode)
self.channel.writeAndFlush(compressedFrame, promise: promise)
}
catch {
logger.error("\(error)")
}
}
else {
let frame = WebSocketFrame(
Expand Down Expand Up @@ -352,8 +347,7 @@ public final class WebSocket: Sendable {
case .text, .binary:
// is compressed, has pmce configured and enabled ?
if frame.rsv1 ,
let pmce = pmce,
pmce.enabled {
let pmce = pmce {

do {
let newFrame:WebSocketFrame
Expand All @@ -377,9 +371,6 @@ public final class WebSocket: Sendable {
}
else if frame.rsv1 && pmce == nil {

if pmce?.logging ?? false {
logger.error("received compressed frame without PMCE configured! Closing per RFC-7692. You could have a configuration issue or something went wrong with PMCE negotiation.")
}
self.close(code: .protocolError, promise: nil)

}
Expand Down

0 comments on commit cd7e448

Please sign in to comment.