         return .needMoreData
     }
 
-    /// Apply a number of validations to the incremental state, ensuring that the frame we're
-    /// receiving is valid.
-    private func validateState() throws {
-        if let length = parser.length, length > self.maxFrameSize {
-            throw NIOWebSocketError.invalidFrameLength
-        }
-
-        if let length = parser.length, let firstByte = parser.firstByte {
-            let isControlFrame = (firstByte & 0x08) != 0
-            let isFragment = (firstByte & 0x80) == 0
-
-            if isControlFrame && isFragment {
-                throw NIOWebSocketError.fragmentedControlFrame
-            }
-            if isControlFrame && length > 125 {
-                throw NIOWebSocketError.multiByteControlFrameLength
-            }
-        }
-    }
+
 
     /// We hit a decoding error, we're going to tear things down now. To do this we're
     /// basically going to send an error frame and then close the connection. Once we're

                ctx.fireChannelRead(self.wrapInboundOut(frame))
            case .continueParsing:
                do {
                    try self.validateState()
                } catch {
                    self.handleError(error, ctx: ctx)
                }


    /// The initial frame byte has been received, but the length byte
    /// has not.
    case firstByteReceived(firstByte: UInt8)

    /// The length byte indicates that we need to wait for the length word, and we're
    /// currently waiting for it.
    case waitingForLengthWord(firstByte: UInt8, masked: Bool)

    /// The length byte indicates that we need to wait for the length qword, and
    /// we're currently waiting for it.
    case waitingForLengthQWord(firstByte: UInt8, masked: Bool)

    /// The mask bit indicates we are expecting a mask key.
    case waitingForMask(firstByte: UInt8, length: Int)

    /// All the header data is complete, we are waiting for the application data.
    case waitingForData(firstByte: UInt8, length: Int, maskingKey: WebSocketMaskingKey?)
}

enum ParseResult {
