Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import PackageDescription

let extraSettings: [SwiftSetting] = [
.strictMemorySafety(),
.enableExperimentalFeature("SuppressedAssociatedTypesWithDefaults"),
.enableExperimentalFeature("LifetimeDependence"),
.enableExperimentalFeature("Lifetimes"),
Expand Down Expand Up @@ -49,43 +50,33 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/apple/swift-http-api-proposal.git",
revision: "d58fd6fa157e08bff44aa360ff83ebd424783392"
revision: "c12fdd4c48953a691b1ce52357101e844e5f0887"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we safe to point at 0.1.0? Or should we continue to update the revision pin like this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried but Swift doesn't allow it since swift-http-api-proposal still uses commit hashes

),
.package(
url: "https://github.com/apple/swift-async-algorithms.git",
revision: "3bd2de010e30f8d41481e6c7a49a7e7222a878cf",
traits: ["UnstableAsyncStreaming"]
),
.package(url: "https://github.com/apple/swift-http-types.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-distributed-tracing.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-certificates.git", from: "1.16.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-distributed-tracing.git", from: "1.4.1"),
.package(url: "https://github.com/apple/swift-certificates.git", from: "1.19.1"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.13.2"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.100.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.36.0"),
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.30.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.37.0"),
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.34.1"),
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.44.0"),
.package(url: "https://github.com/apple/swift-configuration.git", from: "1.0.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.10.0"),
.package(url: "https://github.com/apple/swift-configuration.git", from: "1.2.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.11.0"),
],
targets: [
.executableTarget(
name: "Example",
dependencies: [
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "Tracing", package: "swift-distributed-tracing"),
.product(name: "Instrumentation", package: "swift-distributed-tracing"),
.product(name: "Logging", package: "swift-log"),
.product(name: "HTTPAPIs", package: "swift-http-api-proposal"),
"NIOHTTPServer",
],
swiftSettings: extraSettings
),
.target(
name: "NIOHTTPServer",
dependencies: [
.product(name: "AsyncStreaming", package: "swift-async-algorithms"),
.product(name: "X509", package: "swift-certificates"),
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
Expand Down
8 changes: 3 additions & 5 deletions Sources/Example/Example.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
//
//===----------------------------------------------------------------------===//

import BasicContainers
import Crypto
import Foundation
import HTTPAPIs
import HTTPTypes
import Instrumentation
import Logging
import NIOHTTPServer
Expand All @@ -34,7 +33,6 @@ struct Example {
var logger = Logger(label: "Logger")
logger.logLevel = .trace

// Using the new extension method that doesn't require type hints
let privateKey = P256.Signing.PrivateKey()
let server = NIOHTTPServer(
logger: logger,
Expand Down Expand Up @@ -64,8 +62,8 @@ struct Example {
)

try await server.serve { request, requestContext, requestBodyAndTrailers, responseSender in
let writer = try await responseSender.send(HTTPResponse(status: .ok))
try await writer.writeAndConclude("Well, hello!".utf8.span, finalElement: nil)
var body = UniqueArray<UInt8>(copying: "Well, hello!".utf8)
try await responseSender.sendAndFinish(HTTPResponse(status: .ok), buffer: &body)
}
}
}
2 changes: 0 additions & 2 deletions Sources/NIOHTTPServer/Disconnected.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//

#if compiler(>=6.1)
// This is a helper type to move a non-Sendable value across isolation regions.
@usableFromInline
struct Disconnected<Value: ~Copyable>: ~Copyable, Sendable {
Expand All @@ -38,4 +37,3 @@ struct Disconnected<Value: ~Copyable>: ~Copyable, Sendable {
return unsafe value
}
}
#endif
1 change: 0 additions & 1 deletion Sources/NIOHTTPServer/HTTPKeepAliveHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//

import HTTPTypes
import NIOCore
import NIOHTTPTypes

Expand Down
194 changes: 0 additions & 194 deletions Sources/NIOHTTPServer/HTTPRequestConcludingAsyncReader.swift

This file was deleted.

Loading