1
0
mirror of https://github.com/apple/swift-nio-extras.git synced 2025-05-28 09:23:41 +08:00

Deprecate cumulationBuffer ()

Motivation:

It is no longer used.

Modifications:

Deprecate the 3 cumulationBuffers

Result:

Less confusion and accidental usage.
This commit is contained in:
Peter Adams 2022-08-02 09:46:57 +01:00 committed by GitHub
parent f4359b987d
commit ca22c12528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

@ -32,6 +32,7 @@ public final class FixedLengthFrameDecoder: ByteToMessageDecoder {
public typealias InboundIn = ByteBuffer public typealias InboundIn = ByteBuffer
public typealias InboundOut = ByteBuffer public typealias InboundOut = ByteBuffer
@available(*, deprecated, message: "No longer used")
public var cumulationBuffer: ByteBuffer? public var cumulationBuffer: ByteBuffer?
private let frameLength: Int private let frameLength: Int

@ -105,7 +105,8 @@ public final class LengthFieldBasedFrameDecoder: ByteToMessageDecoder {
public typealias InboundIn = ByteBuffer public typealias InboundIn = ByteBuffer
public typealias InboundOut = ByteBuffer public typealias InboundOut = ByteBuffer
@available(*, deprecated, message: "No longer used")
public var cumulationBuffer: ByteBuffer? public var cumulationBuffer: ByteBuffer?
private var readState: DecoderReadState = .waitingForHeader private var readState: DecoderReadState = .waitingForHeader

@ -33,6 +33,8 @@ import NIOCore
public class LineBasedFrameDecoder: ByteToMessageDecoder { public class LineBasedFrameDecoder: ByteToMessageDecoder {
public typealias InboundIn = ByteBuffer public typealias InboundIn = ByteBuffer
public typealias InboundOut = ByteBuffer public typealias InboundOut = ByteBuffer
@available(*, deprecated, message: "No longer used")
public var cumulationBuffer: ByteBuffer? public var cumulationBuffer: ByteBuffer?
// keep track of the last scan offset from the buffer's reader index (if we didn't find the delimiter) // keep track of the last scan offset from the buffer's reader index (if we didn't find the delimiter)
private var lastScanOffset = 0 private var lastScanOffset = 0