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 authored and GitHub committed 2026-09-13 15:44:35 -07:00
1 parent 7565a07922
commit 7c41198f44
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) {