[pacman-dev] [PATCH] libalpm: fix payloads not being reset between servers

morganamilo morganamilo at archlinux.org
Sun Jan 17 01:18:55 UTC 2021


This was originally fixed in e83e868a77865d42a33076605f9a90a165f7c93a
but removed when implementing parallel downloads.

---

Some what untested. Just need to wait for my internet to act up again.

diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index df5e8be7..3a65da7f 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -367,6 +367,12 @@ static int curl_retry_next_server(CURLM *curlm, CURL *curl, struct dload_payload
 		fseek(payload->localf, 0, SEEK_SET);
 	}
 
+
+	/* reset progress for next server */
+	payload->initial_size += payload->prevprogress;
+	payload->prevprogress = 0;
+	payload->unlink_on_fail = 0;
+
 	/* Set curl with the new URL */
 	curl_easy_setopt(curl, CURLOPT_URL, payload->fileurl);
 
-- 
2.30.0


More information about the pacman-dev mailing list