You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// - request: The URLRequest for the file to download
118
+
/// - resumeSize: The number of bytes already downloaded. If set to 0 (default), the whole file is download. If set to a positive number, the download will resume at the given position
119
+
/// - numRetries: The number of retry attempts remaining for failed downloads
120
+
/// - expectedSize: The expected size of the file to download. If set, the download will raise an error if the size of the received content is different from the expected one.
121
+
/// - Throws: `DownloadError.unexpectedError` if the response is invalid or file size mismatch occurs
122
+
/// `URLError` if the download fails after all retries are exhausted
123
+
privatefunc httpGet(
124
+
request:URLRequest,
125
+
tempFile:FileHandle,
126
+
resumeSize:Int,
127
+
numRetries:Int,
128
+
expectedSize:Int?
129
+
)asyncthrows{
130
+
guardlet session =self.urlSession else{
131
+
throwDownloadError.unexpectedError
132
+
}
133
+
134
+
// Create a new request with Range header for resuming
0 commit comments