diff --git a/Sources/HTTPTypes/HTTPFieldName.swift b/Sources/HTTPTypes/HTTPFieldName.swift index 80b938e..c4defbc 100644 --- a/Sources/HTTPTypes/HTTPFieldName.swift +++ b/Sources/HTTPTypes/HTTPFieldName.swift @@ -557,53 +557,4 @@ extension HTTPField.Name { public static var xContentTypeOptions: Self { .init(rawName: "X-Content-Type-Options", canonicalName: "x-content-type-options") } - - // Deprecated - /// P3P - static var p3P: Self { .init(rawName: "P3P", canonicalName: "p3p") } - /// Pragma - static var pragma: Self { .init(rawName: "Pragma", canonicalName: "pragma") } - /// Timing-Allow-Origin - static var timingAllowOrigin: Self { .init(rawName: "Timing-Allow-Origin", canonicalName: "timing-allow-origin") } - /// X-Frame-Options - static var xFrameOptions: Self { .init(rawName: "X-Frame-Options", canonicalName: "x-frame-options") } - /// X-XSS-Protection - static var xXSSProtection: Self { .init(rawName: "X-XSS-Protection", canonicalName: "x-xss-protection") } - // Internal - /// Alt-Svc - static var altSvc: Self { .init(rawName: "Alt-Svc", canonicalName: "alt-svc") } - /// Keep-Alive - static var keepAlive: Self { .init(rawName: "Keep-Alive", canonicalName: "keep-alive") } - /// Proxy-Connection - static var proxyConnection: Self { .init(rawName: "Proxy-Connection", canonicalName: "proxy-connection") } - /// Upgrade-Insecure-Requests - static var upgradeInsecureRequests: Self { - .init(rawName: "Upgrade-Insecure-Requests", canonicalName: "upgrade-insecure-requests") - } - /// Datagram-Flow-Id - static var datagramFlowId: Self { .init(rawName: "Datagram-Flow-Id", canonicalName: "datagram-flow-id") } - /// Capsule-Protocol - static var capsuleProtocol: Self { .init(rawName: "Capsule-Protocol", canonicalName: "capsule-protocol") } - /// Server-Connection-Id - static var serverConnectionId: Self { - .init(rawName: "Server-Connection-Id", canonicalName: "server-connection-id") - } - /// Client-Connection-Id - static var clientConnectionId: Self { - .init(rawName: "Client-Connection-Id", canonicalName: "client-connection-id") - } - /// Sec-CH-Background - static var secCHBackground: Self { .init(rawName: "Sec-CH-Background", canonicalName: "sec-ch-background") } - /// Sec-CH-Geohash - static var secCHGeohash: Self { .init(rawName: "Sec-CH-Geohash", canonicalName: "sec-ch-geohash") } - /// Client-Geohash - static var clientGeohash: Self { .init(rawName: "Client-Geohash", canonicalName: "client-geohash") } - /// Proxy-QUIC-Forwarding - static var proxyQUICForwarding: Self { - .init(rawName: "Proxy-QUIC-Forwarding", canonicalName: "proxy-quic-forwarding") - } - /// Proxy-Config-Epoch - static var proxyConfigEpoch: Self { .init(rawName: "Proxy-Config-Epoch", canonicalName: "proxy-config-epoch") } - /// Connect-UDP-Bind - static var connectUDPBind: Self { .init(rawName: "Connect-UDP-Bind", canonicalName: "connect-udp-bind") } } diff --git a/Sources/HTTPTypes/NIOLock.swift b/Sources/HTTPTypes/NIOLock.swift index b2e00ed..b06d6ad 100644 --- a/Sources/HTTPTypes/NIOLock.swift +++ b/Sources/HTTPTypes/NIOLock.swift @@ -46,21 +46,16 @@ import wasi_pthread #endif #if os(Windows) -@usableFromInline typealias LockPrimitive = SRWLOCK #elseif canImport(Darwin) -@usableFromInline typealias LockPrimitive = os_unfair_lock #else -@usableFromInline typealias LockPrimitive = pthread_mutex_t #endif -@usableFromInline enum LockOperations {} extension LockOperations { - @inlinable static func create(_ mutex: UnsafeMutablePointer) { mutex.assertValidAlignment() @@ -77,7 +72,6 @@ extension LockOperations { #endif } - @inlinable static func destroy(_ mutex: UnsafeMutablePointer) { mutex.assertValidAlignment() @@ -91,7 +85,6 @@ extension LockOperations { #endif } - @inlinable static func lock(_ mutex: UnsafeMutablePointer) { mutex.assertValidAlignment() @@ -105,7 +98,6 @@ extension LockOperations { #endif } - @inlinable static func unlock(_ mutex: UnsafeMutablePointer) { mutex.assertValidAlignment() @@ -148,10 +140,8 @@ extension LockOperations { // and future maintainers will be happier that we were cautious. // // See also: https://github.com/apple/swift/pull/40000 -@usableFromInline final class LockStorage: ManagedBuffer { - @inlinable static func create(value: Value) -> Self { let buffer = Self.create(minimumCapacity: 1) { _ in value @@ -168,35 +158,30 @@ final class LockStorage: ManagedBuffer { return storage } - @inlinable func lock() { self.withUnsafeMutablePointerToElements { lockPtr in LockOperations.lock(lockPtr) } } - @inlinable func unlock() { self.withUnsafeMutablePointerToElements { lockPtr in LockOperations.unlock(lockPtr) } } - @inlinable deinit { self.withUnsafeMutablePointerToElements { lockPtr in LockOperations.destroy(lockPtr) } } - @inlinable func withLockPrimitive(_ body: (UnsafeMutablePointer) throws -> T) rethrows -> T { try self.withUnsafeMutablePointerToElements { lockPtr in try body(lockPtr) } } - @inlinable func withLockedValue(_ mutate: (inout Value) throws -> T) rethrows -> T { try self.withUnsafeMutablePointers { valuePtr, lockPtr in LockOperations.lock(lockPtr) @@ -209,7 +194,6 @@ final class LockStorage: ManagedBuffer { extension LockStorage: @unchecked Sendable {} extension UnsafeMutablePointer { - @inlinable func assertValidAlignment() { assert(UInt(bitPattern: self) % UInt(MemoryLayout.alignment) == 0) }