Fix unused appcast length fallback if server reports no content size (#2922)

Potentially this could result in an indeterminate progress bar even though the appcast specifies the length of the download.
This commit is contained in:
Zorg committed 2026-09-13 15:47:39 -07:00
1 parent 89f135b438
commit c98fe67b3f
1 file changed
+2 -2
+2 -2
View File
@@ -312,9 +312,9 @@ static bool SPUValidateStatusCodeAndFailIfInvalid(NSURLResponse * _Nullable resp
return;
}
if (totalBytesExpectedToWrite > 0 && !_receivedExpectedBytes) {
if (!_receivedExpectedBytes) {
_receivedExpectedBytes = YES;
[_delegate downloaderDidReceiveExpectedContentLength:totalBytesExpectedToWrite];
[_delegate downloaderDidReceiveExpectedContentLength:(totalBytesExpectedToWrite != NSURLSessionTransferSizeUnknown) ? totalBytesExpectedToWrite : 0];
}
if (bytesWritten >= 0) {