diff options
author | morganamilo <morganamilo@archlinux.org> | 2021-05-09 15:23:57 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2021-05-09 15:28:04 +0200 |
commit | 8bf17b29a24802c587afda0e96d93b22c5f5caeb (patch) | |
tree | de6ac814ba133f7d04036b8c7d22d3e776353d85 /lib/libalpm/alpm.h | |
parent | 4fead44e3ce97d3a83ca6bab393d480746ba9227 (diff) | |
download | pacman-8bf17b29a24802c587afda0e96d93b22c5f5caeb.tar.gz pacman-8bf17b29a24802c587afda0e96d93b22c5f5caeb.tar.xz |
libalpm: fix download rates becoming negative
When a download fails on one mirror a new download is started on the
next mirror. This causes the ammount downloaded to reset, confusing the
rate math and making it display a negative rate.
This is further complicated by the fact that a download may be resumed
from where it is or started over.
To account for this we alert the frontend that the download was
restarted. Pacman then starts the progress bar over.
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/alpm.h')
-rw-r--r-- | lib/libalpm/alpm.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 83bd9f91..aef86d78 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1172,6 +1172,8 @@ typedef enum _alpm_download_event_type_t { ALPM_DOWNLOAD_INIT, /** A download made progress */ ALPM_DOWNLOAD_PROGRESS, + /** Download will be retried */ + ALPM_DOWNLOAD_RETRY, /** A download completed */ ALPM_DOWNLOAD_COMPLETED } alpm_download_event_type_t; @@ -1190,6 +1192,11 @@ typedef struct _alpm_download_event_progress_t { off_t total; } alpm_download_event_progress_t; +/** Context struct for when a download retries. */ +typedef struct _alpm_download_event_retry_t { + /** If the download will resume or start over */ + int resume; +} alpm_download_event_retry_t; /** Context struct for when a download completes. */ typedef struct _alpm_download_event_completed_t { |