mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-05-14 17:02:43 +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: "NIOPosix", package: "swift-nio"),
|
||||
.product(name: "NIOHTTP1", package: "swift-nio"),
|
||||
]
|
||||
],
|
||||
swiftSettings: strictConcurrencySettings
|
||||
),
|
||||
.executableTarget(
|
||||
name: "NIOWritePartialPCAPDemo",
|
||||
@ -78,7 +79,8 @@ var targets: [PackageDescription.Target] = [
|
||||
.product(name: "NIOCore", package: "swift-nio"),
|
||||
.product(name: "NIOPosix", package: "swift-nio"),
|
||||
.product(name: "NIOHTTP1", package: "swift-nio"),
|
||||
]
|
||||
],
|
||||
swiftSettings: strictConcurrencySettings
|
||||
),
|
||||
.executableTarget(
|
||||
name: "NIOExtrasPerformanceTester",
|
||||
@ -104,7 +106,8 @@ var targets: [PackageDescription.Target] = [
|
||||
.product(name: "NIOCore", package: "swift-nio"),
|
||||
.product(name: "NIOPosix", package: "swift-nio"),
|
||||
"NIOSOCKS",
|
||||
]
|
||||
],
|
||||
swiftSettings: strictConcurrencySettings
|
||||
),
|
||||
.target(
|
||||
name: "CNIOExtrasZlib",
|
||||
@ -234,9 +237,7 @@ var targets: [PackageDescription.Target] = [
|
||||
.product(name: "HTTPTypes", package: "swift-http-types"),
|
||||
.product(name: "Algorithms", package: "swift-algorithms"),
|
||||
],
|
||||
swiftSettings: [
|
||||
.enableExperimentalFeature("StrictConcurrency")
|
||||
]
|
||||
swiftSettings: strictConcurrencySettings
|
||||
),
|
||||
.testTarget(
|
||||
name: "NIOHTTPResponsivenessTests",
|
||||
@ -247,9 +248,7 @@ var targets: [PackageDescription.Target] = [
|
||||
.product(name: "NIOEmbedded", package: "swift-nio"),
|
||||
.product(name: "HTTPTypes", package: "swift-http-types"),
|
||||
],
|
||||
swiftSettings: [
|
||||
.enableExperimentalFeature("StrictConcurrency")
|
||||
]
|
||||
swiftSettings: strictConcurrencySettings
|
||||
),
|
||||
]
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
extension HTTPReceiveDiscardHandler: Sendable {}
|
||||
|
@ -143,3 +143,6 @@ public final class SimpleResponsivenessRequestMux: ChannelInboundHandler {
|
||||
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 server = try ServerBootstrap(group: group).childChannelInitializer { channel in
|
||||
channel.pipeline.configureHTTPServerPipeline().flatMap {
|
||||
channel.pipeline.addHandlers([
|
||||
HTTP1ToHTTPServerCodec(secure: false),
|
||||
channel.eventLoop.makeCompletedFuture {
|
||||
let sync = channel.pipeline.syncOperations
|
||||
try sync.configureHTTPServerPipeline()
|
||||
try sync.addHandler(HTTP1ToHTTPServerCodec(secure: false))
|
||||
try sync.addHandler(
|
||||
HTTPResumableUploadHandler(
|
||||
context: uploadContext,
|
||||
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)
|
||||
)
|
||||
]
|
||||
),
|
||||
])
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
.bind(host: "0.0.0.0", port: 8080)
|
||||
|
Loading…
x
Reference in New Issue
Block a user