mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 01:29:41 +01:00
Homebrew Store: Add support for cancelling downloads, fix progress bar. Fixes #9374
This commit is contained in:
1 parent
56e0d5ece2
commit
85c8d9b806
10 files changed
+82
-27
No files matched your search
@@ -183,7 +183,7 @@ bool Buffer::ReadAll(int fd, int hintSize) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Buffer::ReadAllWithProgress(int fd, int knownSize, float *progress) {
|
||||
bool Buffer::ReadAllWithProgress(int fd, int knownSize, float *progress, bool *cancelled) {
|
||||
std::vector<char> buf;
|
||||
if (knownSize >= 65536 * 16) {
|
||||
buf.resize(65536);
|
||||
@@ -195,6 +195,8 @@ bool Buffer::ReadAllWithProgress(int fd, int knownSize, float *progress) {
|
||||
|
||||
int total = 0;
|
||||
while (true) {
|
||||
if (cancelled && *cancelled)
|
||||
return false;
|
||||
int retval = recv(fd, &buf[0], (int)buf.size(), 0);
|
||||
if (retval == 0) {
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user