From d00082dd71c898a360882ae4e3abda868f066bd5 Mon Sep 17 00:00:00 2001 From: Amadeus Date: Mon, 26 Oct 2026 11:39:19 -0300 Subject: [PATCH] mintSources.py: Don't rank mirrors that return HTTP errors in the speed test The speed test downloads dists//.../Packages.gz (or Contents-amd64.gz) with pycurl but never checks the HTTP status. A mirror which doesn't carry the current release answers 404, curl happily "downloads" the error page, and SPEED_DOWNLOAD reports a positive speed. The mirror is then listed with a speed and can end up at the top of the list, and apt update fails after the user picks it. Set FAILONERROR so HTTP errors raise and the mirror is reported as unreachable, like any other download failure. Co-Authored-By: Claude Opus 5.5 --- usr/lib/linuxmint/mintSources/mintSources.py | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/lib/linuxmint/mintSources/mintSources.py b/usr/lib/linuxmint/mintSources/mintSources.py index 3816782..5a797e1 100755 --- a/usr/lib/linuxmint/mintSources/mintSources.py +++ b/usr/lib/linuxmint/mintSources/mintSources.py @@ -717,6 +717,7 @@ def _speed_test_thread(self, task, source_object, task_data, cancellable): c.setopt(pycurl.CONNECTTIMEOUT, 5) c.setopt(pycurl.TIMEOUT, 20) c.setopt(pycurl.FOLLOWLOCATION, 1) + c.setopt(pycurl.FAILONERROR, 1) c.setopt(pycurl.WRITEFUNCTION, buff.write) c.setopt(pycurl.NOSIGNAL, 1) c.setopt(pycurl.USERAGENT, USER_AGENT)