mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-05-15 09:22:38 +08:00
Motivation: Previously, WritePCAPHandler would crash if more than 4GiB of data were either received or sent through the same instance of the WritePCAPHandler because of a UInt32 overflow representing the TCP sequence/ACK numbers. Modifications: Make TCP sequence/ACK numbers wrap around correctly. Result: - now you can send/receive up to 16 EiB of data :P. - fixes rdar://61887658
48 lines
2.3 KiB
Swift
48 lines
2.3 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// WritePCAPHandlerTest+XCTest.swift
|
|
//
|
|
import XCTest
|
|
|
|
///
|
|
/// NOTE: This file was generated by generate_linux_tests.rb
|
|
///
|
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
|
///
|
|
|
|
extension WritePCAPHandlerTest {
|
|
|
|
static var allTests : [(String, (WritePCAPHandlerTest) -> () throws -> Void)] {
|
|
return [
|
|
("testConnectIssuesThreePacketsForIPv4", testConnectIssuesThreePacketsForIPv4),
|
|
("testConnectIssuesThreePacketsForIPv6", testConnectIssuesThreePacketsForIPv6),
|
|
("testAcceptConnectionFromRemote", testAcceptConnectionFromRemote),
|
|
("testCloseOriginatingFromLocal", testCloseOriginatingFromLocal),
|
|
("testCloseOriginatingFromRemote", testCloseOriginatingFromRemote),
|
|
("testInboundData", testInboundData),
|
|
("testOutboundData", testOutboundData),
|
|
("testOversizedInboundDataComesAsTwoPacketsIPv4", testOversizedInboundDataComesAsTwoPacketsIPv4),
|
|
("testOversizedInboundDataComesAsTwoPacketsIPv6", testOversizedInboundDataComesAsTwoPacketsIPv6),
|
|
("testOversizedOutboundDataComesAsTwoPacketsIPv4", testOversizedOutboundDataComesAsTwoPacketsIPv4),
|
|
("testOversizedOutboundDataComesAsTwoPacketsIPv6", testOversizedOutboundDataComesAsTwoPacketsIPv6),
|
|
("testUnflushedOutboundDataIsNotWritten", testUnflushedOutboundDataIsNotWritten),
|
|
("testDataWrittenAfterCloseIsDiscarded", testDataWrittenAfterCloseIsDiscarded),
|
|
("testUnflushedOutboundDataIsWrittenWhenEmittingWritesOnIssue", testUnflushedOutboundDataIsWrittenWhenEmittingWritesOnIssue),
|
|
("testWeDoNotCrashIfMoreThan4GBOfDataGoThrough", testWeDoNotCrashIfMoreThan4GBOfDataGoThrough),
|
|
]
|
|
}
|
|
}
|
|
|