Clean up dependencies and imports. (#1935)

Motivation:

As we've largely completed our move to split out our core abstractions,
we now have an opportunity to clean up our dependencies and imports. We
should arrange for everything to only import NIO if it actually needs
it, and to correctly express dependencies on NIOCore and NIOEmbedded
where they exist.

We aren't yet splitting out tests that only test functionality in
NIOCore, that will follow in a separate patch.

Modifications:

- Fixed up imports
- Made sure our protocols only require NIOCore.

Result:

Better expression of dependencies.

Co-authored-by: George Barnett <gbarnett@apple.com>
This commit is contained in:
Cory Benfield 2021-08-12 13:49:46 +01:00 committed by GitHub
parent f2ab9ab422
commit 64285cbff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
81 changed files with 199 additions and 188 deletions

View File

@ -29,8 +29,8 @@ var targets: [PackageDescription.Target] = [
"_NIODataStructures",
"NIOEmbedded"]),
.target(name: "_NIOConcurrency",
dependencies: ["NIO"]),
.target(name: "NIOFoundationCompat", dependencies: ["NIO"]),
dependencies: ["NIOCore"]),
.target(name: "NIOFoundationCompat", dependencies: ["NIOCore"]),
.target(name: "CNIOAtomics", dependencies: []),
.target(name: "CNIOSHA1", dependencies: []),
.target(name: "CNIOLinux", dependencies: []),
@ -39,59 +39,59 @@ var targets: [PackageDescription.Target] = [
.target(name: "NIOConcurrencyHelpers",
dependencies: ["CNIOAtomics"]),
.target(name: "NIOHTTP1",
dependencies: ["NIO", "NIOConcurrencyHelpers", "CNIOHTTPParser"]),
dependencies: ["NIOCore", "NIOConcurrencyHelpers", "CNIOHTTPParser"]),
.target(name: "NIOEchoServer",
dependencies: ["NIO", "NIOConcurrencyHelpers"]),
dependencies: ["NIO", "NIOCore", "NIOConcurrencyHelpers"]),
.target(name: "NIOEchoClient",
dependencies: ["NIO", "NIOConcurrencyHelpers"]),
dependencies: ["NIO", "NIOCore", "NIOConcurrencyHelpers"]),
.target(name: "NIOHTTP1Server",
dependencies: ["NIO", "NIOHTTP1", "NIOConcurrencyHelpers"]),
dependencies: ["NIO", "NIOCore", "NIOHTTP1", "NIOConcurrencyHelpers"]),
.target(name: "NIOHTTP1Client",
dependencies: ["NIO", "NIOHTTP1", "NIOConcurrencyHelpers"]),
dependencies: ["NIO", "NIOCore", "NIOHTTP1", "NIOConcurrencyHelpers"]),
.target(name: "CNIOHTTPParser"),
.target(name: "NIOTLS", dependencies: ["NIO"]),
.target(name: "NIOTLS", dependencies: ["NIOCore"]),
.target(name: "NIOChatServer",
dependencies: ["NIO", "NIOConcurrencyHelpers"]),
dependencies: ["NIO", "NIOCore", "NIOConcurrencyHelpers"]),
.target(name: "NIOChatClient",
dependencies: ["NIO", "NIOConcurrencyHelpers"]),
dependencies: ["NIO", "NIOCore", "NIOConcurrencyHelpers"]),
.target(name: "NIOWebSocket",
dependencies: ["NIO", "NIOHTTP1", "CNIOSHA1"]),
dependencies: ["NIOCore", "NIOHTTP1", "CNIOSHA1"]),
.target(name: "NIOWebSocketServer",
dependencies: ["NIO", "NIOHTTP1", "NIOWebSocket"]),
dependencies: ["NIO", "NIOCore", "NIOHTTP1", "NIOWebSocket"]),
.target(name: "NIOWebSocketClient",
dependencies: ["NIO", "NIOHTTP1", "NIOWebSocket"]),
dependencies: ["NIO", "NIOCore", "NIOHTTP1", "NIOWebSocket"]),
.target(name: "NIOPerformanceTester",
dependencies: ["NIO", "NIOHTTP1", "NIOFoundationCompat", "NIOWebSocket"]),
dependencies: ["NIO", "NIOCore", "NIOEmbedded", "NIOHTTP1", "NIOFoundationCompat", "NIOWebSocket"]),
.target(name: "NIOMulticastChat",
dependencies: ["NIO"]),
dependencies: ["NIO", "NIOCore"]),
.target(name: "NIOUDPEchoServer",
dependencies: ["NIO"]),
dependencies: ["NIO", "NIOCore"]),
.target(name: "NIOUDPEchoClient",
dependencies: ["NIO"]),
dependencies: ["NIO", "NIOCore"]),
.target(name: "NIOTestUtils",
dependencies: ["NIO", "NIOHTTP1"]),
dependencies: ["NIO", "NIOCore", "NIOEmbedded", "NIOHTTP1"]),
.target(name: "NIOCrashTester",
dependencies: ["NIO", "NIOHTTP1", "NIOWebSocket", "NIOFoundationCompat"]),
dependencies: ["NIO", "NIOCore", "NIOEmbedded", "NIOHTTP1", "NIOWebSocket", "NIOFoundationCompat"]),
.target(name: "NIOAsyncAwaitDemo",
dependencies: ["NIO", "NIOHTTP1", "_NIOConcurrency"]),
dependencies: ["NIO", "NIOCore", "NIOHTTP1", "_NIOConcurrency"]),
.testTarget(name: "NIOEmbeddedTests",
dependencies: ["NIOConcurrencyHelpers", "NIOCore", "NIOEmbedded"]),
.testTarget(name: "NIOTests",
dependencies: ["NIO", "NIOFoundationCompat", "NIOTestUtils", "NIOConcurrencyHelpers", "NIOEmbedded"]),
dependencies: ["NIO", "NIOCore", "NIOFoundationCompat", "NIOTestUtils", "NIOConcurrencyHelpers", "NIOEmbedded"]),
.testTarget(name: "NIOConcurrencyHelpersTests",
dependencies: ["NIOConcurrencyHelpers", "NIO"]),
dependencies: ["NIOConcurrencyHelpers", "NIOCore"]),
.testTarget(name: "NIODataStructuresTests",
dependencies: ["_NIODataStructures"]),
.testTarget(name: "NIOHTTP1Tests",
dependencies: ["NIOHTTP1", "NIOFoundationCompat", "NIOTestUtils"]),
dependencies: ["NIOCore", "NIOEmbedded", "NIO", "NIOHTTP1", "NIOFoundationCompat", "NIOTestUtils"]),
.testTarget(name: "NIOTLSTests",
dependencies: ["NIO", "NIOTLS", "NIOFoundationCompat"]),
dependencies: ["NIOCore", "NIOEmbedded", "NIOTLS", "NIOFoundationCompat"]),
.testTarget(name: "NIOWebSocketTests",
dependencies: ["NIO", "NIOWebSocket"]),
dependencies: ["NIOCore", "NIOEmbedded", "NIOWebSocket"]),
.testTarget(name: "NIOTestUtilsTests",
dependencies: ["NIOTestUtils"]),
.testTarget(name: "NIOFoundationCompatTests",
dependencies: ["NIO", "NIOFoundationCompat"]),
dependencies: ["NIOCore", "NIOFoundationCompat"]),
]
let package = Package(

View File

@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOHTTP1
#if compiler(>=5.5) // we cannot write this on one line with `&&` because Swift 5.0 doesn't like it...

View File

@ -14,7 +14,7 @@
// THIS FILE IS MOSTLY COPIED FROM swift-nio-extras
import NIO
import NIOCore
import NIOHTTP1
public final class MakeFullRequestHandler: ChannelOutboundHandler {

View File

@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import _NIOConcurrency
import NIOHTTP1

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
private final class ChatHandler: ChannelInboundHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import Dispatch

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
struct ByteBufferCrashTests {
let testMovingReaderIndexPastWriterIndex = CrashTest(

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
fileprivate let group = MultiThreadedEventLoopGroup(numberOfThreads: 2)

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,8 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOEmbedded
import NIOCore
import NIOHTTP1
struct HTTPCrashTests {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import NIOFoundationCompat
import class Foundation.Pipe

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import class Foundation.Process
import struct Foundation.URL

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
print("Please enter line to send to the server")

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
private final class EchoHandler: ChannelInboundHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import Foundation

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import Foundation
extension ByteBuffer {

View File

@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import Foundation
extension JSONSerialization {
@ -28,4 +28,4 @@ extension JSONSerialization {
options opt: JSONSerialization.ReadingOptions = []) throws -> Any {
return try JSONSerialization.jsonObject(with: Data(buffer: buffer), options: opt)
}
}
}

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
fileprivate let defaultWhitespaces = [" ", "\t"].map({$0.utf8.first!})

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
#if compiler(>=5.1)
@_implementationOnly import CNIOHTTPParser
#else

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
private func writeChunk(wrapOutboundOut: (IOData) -> NIOAny, context: ChannelHandlerContext, isChunked: Bool, chunk: IOData, promise: EventLoopPromise<Void>?) {
let (mW1, mW2, mW3): (EventLoopPromise<Void>?, EventLoopPromise<Void>?, EventLoopPromise<Void>?)

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// Configuration required to configure a HTTP client pipeline for upgrade.
///

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,14 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// HTTPServerPipelineHandler.swift
// NIOHTTP1
//
// Created by Cory Benfield on 01/03/2018.
//
import NIO
import NIOCore
/// A utility function that runs the body code only in debug builds, without
/// emitting compiler warnings.

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// A simple channel handler that catches errors emitted by parsing HTTP requests
/// and sends 400 Bad Request responses.

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// Errors that may be raised by the `HTTPServerProtocolUpgrader`.
public enum HTTPServerUpgradeErrors: Error {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
let crlf: StaticString = "\r\n"
let headerSeparator: StaticString = ": "

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// Errors that may be raised by the `HTTPClientProtocolUpgrader`.
public struct NIOHTTPClientUpgradeError: Hashable, Error {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// The parts of a complete HTTP response from the view of the client.
///

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import NIOHTTP1

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import NIOHTTP1

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
/// Implements a simple chat protocol.

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import Foundation
import NIO
import NIOCore
final class ByteBufferViewIteratorBenchmark: Benchmark {
private let iterations: Int

View File

@ -11,8 +11,8 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOEmbedded
final class ByteToMessageDecoderDecodeManySmallsBenchmark: Benchmark {
private let iterations: Int

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,8 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOEmbedded
final class ChannelPipelineBenchmark: Benchmark {
private final class NoOpHandler: ChannelInboundHandler, RemovableChannelHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import Foundation
import NIO
import NIOCore
final class CircularBufferIntoByteBufferBenchmark: Benchmark {
private let iterations: Int

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,8 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOEmbedded
import NIOWebSocket
final class WebSocketFrameDecoderBenchmark {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,8 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOEmbedded
import NIOWebSocket
final class WebSocketFrameEncoderBenchmark {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,9 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import NIOEmbedded
import NIOHTTP1
import NIOFoundationCompat
import Dispatch

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// The result of an ALPN negotiation.
///

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// The length of the TLS record header in bytes.
private let tlsRecordHeaderLength = 5

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,8 +11,8 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOEmbedded
public enum ByteToMessageDecoderVerifier {
/// - seealso: verifyDecoder(inputOutputPairs:decoderFactory:)

View File

@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOConcurrencyHelpers
/// `EventCounterHandler` is a `ChannelHandler` that counts and forwards all the events that it sees coming through

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import NIOHTTP1
import NIOConcurrencyHelpers

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
print("Please enter line to send to the server")

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
private final class EchoHandler: ChannelInboundHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOHTTP1
@available(*, deprecated, renamed: "NIOWebSocketClientUpgrader")

View File

@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// `NIOWebSocketFrameAggregator` buffers inbound fragmented `WebSocketFrame`'s and aggregates them into a single `WebSocketFrame`.

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import CNIOSHA1
import NIO
import NIOCore
import NIOHTTP1
let magicWebSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// An enum that represents websocket error codes.
///

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
private extension UInt8 {
func isAnyBitSetInMask(_ mask: UInt8) -> Bool {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// Errors thrown by the NIO websocket module.
public enum NIOWebSocketError: Error {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
private let maxOneByteSize = 125
private let maxTwoByteSize = Int(UInt16.max)

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// A simple `ChannelHandler` that catches protocol errors emitted by the

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import NIOHTTP1
import NIOWebSocket

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,7 +11,7 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
import NIO
import NIOHTTP1
import NIOWebSocket

View File

@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
#if compiler(>=5.5)
import _Concurrency

View File

@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
#if compiler(>=5.5)
fileprivate let hasAsyncAwait = true
@ -20,7 +20,7 @@ fileprivate let hasAsyncAwait = true
fileprivate let hasAsyncAwait = false
#endif
extension NIO.System {
extension NIOCore.System {
public static var hasAsyncAwaitSupport: Bool {
return hasAsyncAwait
}

View File

@ -18,7 +18,7 @@ import Glibc
#endif
import Dispatch
import XCTest
import NIO
import NIOCore
@testable import NIOConcurrencyHelpers
class NIOConcurrencyHelpersTests: XCTestCase {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -14,7 +14,7 @@
import Foundation
import XCTest
import NIO
import NIOCore
import NIOFoundationCompat
struct FakeContiguousBytes: ContiguousBytes {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -14,7 +14,7 @@
import Foundation
import XCTest
import NIO
import NIOCore
import NIOFoundationCompat
class ByteBufferViewDataProtocolTests: XCTestCase {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -14,7 +14,7 @@
import Foundation
import XCTest
import NIO
import NIOCore
import NIOFoundationCompat
class CodableByteBufferTest: XCTestCase {

View File

@ -14,7 +14,7 @@
import Foundation
import XCTest
import NIO
import NIOCore
import NIOFoundationCompat
class JSONSerializationByteBufferTest: XCTestCase {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
@testable import NIOHTTP1
fileprivate enum DummyError: Error {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -14,7 +14,8 @@
import XCTest
import Dispatch
@testable import NIO
@testable import NIOCore
import NIOEmbedded
@testable import NIOHTTP1
extension EmbeddedChannel {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP1
private class MessageEndHandler<Head: Equatable, Body: Equatable>: ChannelInboundHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP1
import NIOTestUtils

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
@testable import NIO
@testable import NIOCore
import NIOEmbedded
@testable import NIOHTTP1
class HTTPHeadersTest : XCTestCase {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import XCTest
@testable import NIO
@testable import NIOCore
import NIOEmbedded
@testable import NIOHTTP1
private extension ByteBuffer {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import XCTest
@testable import NIO
@testable import NIOCore
import NIOEmbedded
@testable import NIOHTTP1
private extension ByteBuffer {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIOCore
import NIO
import NIOConcurrencyHelpers
import NIOFoundationCompat

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -11,15 +11,10 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// HTTPServerPipelineHandlerTest.swift
// NIOHTTP1Tests
//
// Created by Cory Benfield on 02/03/2018.
//
import XCTest
import NIO
import NIOCore
import NIOEmbedded
@testable import NIOHTTP1
private final class ReadRecorder: ChannelInboundHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP1
class HTTPServerProtocolErrorHandlerTest: XCTestCase {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -14,6 +14,8 @@
import XCTest
import Dispatch
import NIOCore
import NIOEmbedded
@testable import NIO
@testable import NIOHTTP1

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
@testable import NIO
@testable import NIOCore
import NIOEmbedded
@testable import NIOHTTP1
private final class TestChannelInboundHandler: ChannelInboundHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP1
import NIOTestUtils

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
@testable import NIO
import NIOCore
import NIOEmbedded
import NIOTLS
private class ReadCompletedHandler: ChannelInboundHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import XCTest
@testable import NIO
import NIOCore
import NIOEmbedded
import NIOFoundationCompat
import NIOTLS

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
import NIOEmbedded
import NIOWebSocket
final class NIOWebSocketFrameAggregatorTests: XCTestCase {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2019-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
@testable import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP1
@testable import NIOWebSocket

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
import NIOEmbedded
import NIOWebSocket
private class CloseSwallower: ChannelOutboundHandler, RemovableChannelHandler {

View File

@ -2,7 +2,7 @@
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
import NIOEmbedded
import NIOWebSocket
extension EmbeddedChannel {

View File

@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import XCTest
import NIO
import NIOCore
import NIOWebSocket
final class WebSocketMaskingKeyTests: XCTestCase {

View File

@ -14,7 +14,7 @@
import XCTest
@testable import NIOCore
import NIO
import NIOEmbedded
import NIOHTTP1
@testable import NIOWebSocket