Fix a segfault in ReadAllWithProgress

This commit is contained in:
Hoe Hao Cheng committed 2023-07-23 01:18:08 +08:00
1 parent 8cfc4fe60d
commit 9305870cca
1 file changed
+2 -2
+2 -2
View File
@@ -76,8 +76,8 @@ bool Buffer::ReadAllWithProgress(int fd, int knownSize, RequestProgress *progres
int total = 0;
while (true) {
bool ready = false;
while (!ready && (!progress || !*progress->cancelled)) {
if (*progress->cancelled)
while (!ready && (!progress || (progress->cancelled && !*progress->cancelled))) {
if (progress && progress->cancelled && *progress->cancelled)
return false;
ready = fd_util::WaitUntilReady(fd, CANCEL_INTERVAL, false);
}