mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-05-15 01:18:58 +08:00
Merge branch 'main' into strict-concurrency-http-types
This commit is contained in:
commit
0b270b4e29
@ -69,7 +69,8 @@ var targets: [PackageDescription.Target] = [
|
|||||||
.product(name: "NIOCore", package: "swift-nio"),
|
.product(name: "NIOCore", package: "swift-nio"),
|
||||||
.product(name: "NIOPosix", package: "swift-nio"),
|
.product(name: "NIOPosix", package: "swift-nio"),
|
||||||
.product(name: "NIOHTTP1", package: "swift-nio"),
|
.product(name: "NIOHTTP1", package: "swift-nio"),
|
||||||
]
|
],
|
||||||
|
swiftSettings: strictConcurrencySettings
|
||||||
),
|
),
|
||||||
.executableTarget(
|
.executableTarget(
|
||||||
name: "NIOWritePartialPCAPDemo",
|
name: "NIOWritePartialPCAPDemo",
|
||||||
@ -78,7 +79,8 @@ var targets: [PackageDescription.Target] = [
|
|||||||
.product(name: "NIOCore", package: "swift-nio"),
|
.product(name: "NIOCore", package: "swift-nio"),
|
||||||
.product(name: "NIOPosix", package: "swift-nio"),
|
.product(name: "NIOPosix", package: "swift-nio"),
|
||||||
.product(name: "NIOHTTP1", package: "swift-nio"),
|
.product(name: "NIOHTTP1", package: "swift-nio"),
|
||||||
]
|
],
|
||||||
|
swiftSettings: strictConcurrencySettings
|
||||||
),
|
),
|
||||||
.executableTarget(
|
.executableTarget(
|
||||||
name: "NIOExtrasPerformanceTester",
|
name: "NIOExtrasPerformanceTester",
|
||||||
@ -104,7 +106,8 @@ var targets: [PackageDescription.Target] = [
|
|||||||
.product(name: "NIOCore", package: "swift-nio"),
|
.product(name: "NIOCore", package: "swift-nio"),
|
||||||
.product(name: "NIOPosix", package: "swift-nio"),
|
.product(name: "NIOPosix", package: "swift-nio"),
|
||||||
"NIOSOCKS",
|
"NIOSOCKS",
|
||||||
]
|
],
|
||||||
|
swiftSettings: strictConcurrencySettings
|
||||||
),
|
),
|
||||||
.target(
|
.target(
|
||||||
name: "CNIOExtrasZlib",
|
name: "CNIOExtrasZlib",
|
||||||
@ -234,9 +237,7 @@ var targets: [PackageDescription.Target] = [
|
|||||||
.product(name: "HTTPTypes", package: "swift-http-types"),
|
.product(name: "HTTPTypes", package: "swift-http-types"),
|
||||||
.product(name: "Algorithms", package: "swift-algorithms"),
|
.product(name: "Algorithms", package: "swift-algorithms"),
|
||||||
],
|
],
|
||||||
swiftSettings: [
|
swiftSettings: strictConcurrencySettings
|
||||||
.enableExperimentalFeature("StrictConcurrency")
|
|
||||||
]
|
|
||||||
),
|
),
|
||||||
.testTarget(
|
.testTarget(
|
||||||
name: "NIOHTTPResponsivenessTests",
|
name: "NIOHTTPResponsivenessTests",
|
||||||
@ -247,9 +248,7 @@ var targets: [PackageDescription.Target] = [
|
|||||||
.product(name: "NIOEmbedded", package: "swift-nio"),
|
.product(name: "NIOEmbedded", package: "swift-nio"),
|
||||||
.product(name: "HTTPTypes", package: "swift-http-types"),
|
.product(name: "HTTPTypes", package: "swift-http-types"),
|
||||||
],
|
],
|
||||||
swiftSettings: [
|
swiftSettings: strictConcurrencySettings
|
||||||
.enableExperimentalFeature("StrictConcurrency")
|
|
||||||
]
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -253,3 +253,6 @@ public final class HTTPDrippingDownloadHandler: ChannelDuplexHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(*, unavailable)
|
||||||
|
extension HTTPDrippingDownloadHandler: Sendable {}
|
||||||
|
@ -88,3 +88,6 @@ public final class HTTPReceiveDiscardHandler: ChannelInboundHandler {
|
|||||||
context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil)
|
context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(*, unavailable)
|
||||||
|
extension HTTPReceiveDiscardHandler: Sendable {}
|
||||||
|
@ -143,3 +143,6 @@ public final class SimpleResponsivenessRequestMux: ChannelInboundHandler {
|
|||||||
context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil)
|
context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(*, unavailable)
|
||||||
|
extension SimpleResponsivenessRequestMux: Sendable {}
|
||||||
|
@ -101,9 +101,11 @@ if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
|
|||||||
|
|
||||||
let group = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount)
|
let group = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount)
|
||||||
let server = try ServerBootstrap(group: group).childChannelInitializer { channel in
|
let server = try ServerBootstrap(group: group).childChannelInitializer { channel in
|
||||||
channel.pipeline.configureHTTPServerPipeline().flatMap {
|
channel.eventLoop.makeCompletedFuture {
|
||||||
channel.pipeline.addHandlers([
|
let sync = channel.pipeline.syncOperations
|
||||||
HTTP1ToHTTPServerCodec(secure: false),
|
try sync.configureHTTPServerPipeline()
|
||||||
|
try sync.addHandler(HTTP1ToHTTPServerCodec(secure: false))
|
||||||
|
try sync.addHandler(
|
||||||
HTTPResumableUploadHandler(
|
HTTPResumableUploadHandler(
|
||||||
context: uploadContext,
|
context: uploadContext,
|
||||||
handlers: [
|
handlers: [
|
||||||
@ -111,8 +113,8 @@ if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
|
|||||||
directory: URL(fileURLWithPath: CommandLine.arguments[1], isDirectory: true)
|
directory: URL(fileURLWithPath: CommandLine.arguments[1], isDirectory: true)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
),
|
)
|
||||||
])
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.bind(host: "0.0.0.0", port: 8080)
|
.bind(host: "0.0.0.0", port: 8080)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user