We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6aa80af commit 49440e5Copy full SHA for 49440e5
Sources/SwiftOCA/OCP.1/Backend/Ocp1FlyingSocksConnection.swift
@@ -190,16 +190,9 @@ public final class Ocp1FlyingSocksStreamConnection: Ocp1FlyingSocksConnection {
190
override var socketType: SocketType { .stream }
191
192
override public func read(_ length: Int) async throws -> Data {
193
- var data = Data()
194
-
195
try await withMappedError { socket in
196
- while data.count < length {
197
- let receivedData = try await Data(socket.read(atMost: length - data.count))
198
- data += receivedData
199
- }
+ try await Data(socket.read(bytes: length))
200
}
201
202
- return data
203
204
205
override func setSocketOptions(_ socket: Socket) throws {
0 commit comments