net: Fix request cancelling.

Was broken in #17737.
This commit is contained in:
Unknown W. Brackets committed 2023-07-25 19:42:37 -07:00
1 parent 8f404a1961
commit 94f7231e73
2 files changed
+6 -6

No files matched your search

+6 -2
View File
@@ -76,11 +76,15 @@ bool Buffer::ReadAllWithProgress(int fd, int knownSize, RequestProgress *progres
int total = 0;
while (true) {
bool ready = false;
while (!ready && (!progress || (progress->cancelled && !*progress->cancelled))) {
if (progress && progress->cancelled && *progress->cancelled)
// If we might need to cancel, check on a timer for it to be ready.
// After this, we'll block on reading so we do this while first if we have a cancel pointer.
while (!ready && progress && progress->cancelled) {
if (*progress->cancelled)
return false;
ready = fd_util::WaitUntilReady(fd, CANCEL_INTERVAL, false);
}
int retval = recv(fd, &buf[0], (int)buf.size(), MSG_NOSIGNAL);
if (retval == 0) {
return true;
-4
View File
@@ -235,10 +235,6 @@ void OnScreenDisplay::SetProgressBar(std::string id, std::string &&message, floa
}
}
if (message == "dorequest.php") {
found = found;
}
ProgressBar bar;
bar.id = id;
bar.message = std::move(message);