diff --git a/Sources/libwebsockets/WebsocketClientContext.swift b/Sources/libwebsockets/WebsocketClientContext.swift index a5f274c..cda21a4 100644 --- a/Sources/libwebsockets/WebsocketClientContext.swift +++ b/Sources/libwebsockets/WebsocketClientContext.swift @@ -131,7 +131,7 @@ internal final class WebsocketClientContext { lwsProtocols.callback = _lws_swift_websocketClientCallback lwsProtocols.per_session_data_size = 0 // TODO: Per instance customization? - lwsProtocols.rx_buffer_size = 1000000 + lwsProtocols.rx_buffer_size = 4000000 protocolsPointer.initialize(to: lwsProtocols) diff --git a/Sources/libwebsockets/WebsocketFrameSequence.swift b/Sources/libwebsockets/WebsocketFrameSequence.swift index 1c30759..a6f0d7f 100644 --- a/Sources/libwebsockets/WebsocketFrameSequence.swift +++ b/Sources/libwebsockets/WebsocketFrameSequence.swift @@ -15,25 +15,21 @@ public struct WebsocketSimpleAppendFrameSequence: WebsocketFrameSequence { private(set) public var binaryBuffer: Data private(set) public var textBuffer: Data public let type: WebsocketOpcode - private let lock: NIOLock public init(type: WebsocketOpcode) { self.binaryBuffer = Data() self.textBuffer = Data() self.type = type - self.lock = .init() } public mutating func append(_ frame: Data) { - self.lock.withLockVoid { - switch type { - case .binary: - self.binaryBuffer.append(frame) - case .text: - self.textBuffer.append(frame) - default: - break - } + switch type { + case .binary: + self.binaryBuffer.append(frame) + case .text: + self.textBuffer.append(frame) + default: + break } } }