Fix actor-isolation warning in CLIServerService's connection handler

sendAndClose is main-actor-isolated (implicit under -default-isolation
MainActor), but the Task in readRequest's Network.framework callback
runs nonisolated (DisableOutwardActorInference means it no longer
inherits the class's actor from lexical context). Calling sendAndClose
without hopping onto the actor is a hard error in Swift 6 mode.
This commit is contained in:
2026-08-11 10:45:17 +02:00
parent 087ada6ae4
commit ef6265c1c5
+1 -1
View File
@@ -132,7 +132,7 @@ final class CLIServerService {
if let body = Self.parseRequestBody(from: buffer) {
Task {
let responseData = await self.processRequest(body)
self.sendAndClose(responseData, on: connection)
await self.sendAndClose(responseData, on: connection)
}
return
}