diff --git a/Tun/Super/SDLSuperClient.swift b/Tun/Super/SDLSuperClient.swift index a768047..8268832 100644 --- a/Tun/Super/SDLSuperClient.swift +++ b/Tun/Super/SDLSuperClient.swift @@ -12,7 +12,7 @@ import CryptoKit import Security // 定义错误类型,便于上层处理 -enum SDLQUICError: Error { +enum SDLSuperError: Error { case connectionFailed(Error) case connectionCancelled case writeFailed(Error) @@ -123,7 +123,7 @@ actor SDLSuperClient { } } - private func finishMessageContinuationIfNeed(throwing error: SDLQUICError?) { + private func finishMessageContinuationIfNeed(throwing error: SDLSuperError?) { guard !self.isMessageContinuationFinished else { return } @@ -181,7 +181,7 @@ actor SDLSuperClient { private func readOnce() async throws -> Data { guard let connection = self.connection else { - throw SDLQUICError.connectionCancelled + throw SDLSuperError.connectionCancelled } let readContinuation = OnceContinuation() @@ -196,7 +196,7 @@ actor SDLSuperClient { } if isComplete { - readContinuation.resume(throwing: SDLQUICError.dataStreamClosed) + readContinuation.resume(throwing: SDLSuperError.dataStreamClosed) } else { readContinuation.resume(returning: data ?? Data()) } @@ -263,7 +263,7 @@ extension SDLSuperClient { } if len > self.maxPacketSize { - throw SDLQUICError.packetTooLarge + throw SDLSuperError.packetTooLarge } guard buffer.readableBytes >= len + 2 else {