summaryrefslogtreecommitdiff
path: root/methods/mirror.cc
AgeCommit message (Collapse)AuthorFilesLines
2016-08-10implement generic config fallback for methodsDavid Kalnischkies1-2/+2
The https method implemented for a long while now a hardcoded fallback to the same options in http, which, while it works, is rather inflexible if we want to allow the methods to use another name to change their behavior slightly, like apt-transport-tor does to https – most of the diff being s#https#tor#g which then fails to do the full circle fallthrough tor -> https -> http for https sources. With this config infrastructure this could be implemented now.
2016-05-28use std::locale::global instead of setlocaleDavid Kalnischkies1-6/+1
We use a wild mixture of C and C++ ways of generating output, so having a consistent world-view in both styles sounds like a good idea and should help in preventing regressions.
2015-11-19ignore lost+found in private directory cleanupDavid Kalnischkies1-0/+1
In ce1f3a2c we started warning about failing unlinking, which we consistently do for directories. That isn't a problem as directories usually aren't in the places we do want to clean up – with the potential exeception of "lost+found", so lets ignore it like we ignore our own partial/ subdirectory. Closes: 805424
2015-11-04wrap every unlink call to check for != /dev/nullDavid Kalnischkies1-1/+1
Unlinking /dev/null is bad, we shouldn't do that. Also, we should print at least a warning if we tried to unlink a file but didn't manage to pull it of (ignoring the case were the file is /dev/null or doesn't exist in the first place). This got triggered by a relatively unlikely to cause problem in pkgAcquire::Worker::PrepareFiles which would while temporary uncompressed files (which are set to keep compressed) figure out that to files are the same and prepare for sharing by deleting them. Bad move. That also shows why not printing a warning is a bad idea as this hide the error for in non-root test runs. Git-Dch: Ignore
2014-03-13cleanup headers and especially #includes everywhereDavid Kalnischkies1-5/+5
Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
2014-03-13warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies1-1/+1
Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
2014-03-13warning: extra ‘;’ [-Wpedantic]David Kalnischkies1-14/+14
Git-Dch: Ignore Reported-By: gcc -Wpedantic
2014-02-22Fix typos in documentation (codespell)Michael Vogt1-3/+3
2014-01-16correct some style/performance/warnings from cppcheckDavid Kalnischkies1-4/+4
The most "visible" change is from utime to utimensat/futimens as the first one isn't part of POSIX anymore. Reported-By: cppcheck Git-Dch: Ignore
2013-06-06Fix double free (closes: #711045)Michael Vogt1-0/+3
* Fix double free (closes: #711045) * Fix crash when the "mirror" method does not find any entry (closes: #699303)
2012-05-14* methods/mirror.cc:Raphael Geissert1-1/+1
- generate an equal sign also for the first arch (Closes: #669142)
2012-03-20* methods/rred.cc:David Kalnischkies1-2/+3
- check return of writev() as gcc recommends * methods/mirror.cc: - check return of chdir() as gcc recommends * apt-pkg/deb/dpkgpm.cc: - check return of write() a gcc recommends * apt-inst/deb/debfile.cc: - check return of chdir() as gcc recommends * apt-inst/deb/dpkgdb.cc: - check return of chdir() as gcc recommends
2012-03-05micro-optimize "(performance) Prefer prefix ++/-- operators for ↵David Kalnischkies1-1/+1
non-primitive types."
2011-09-19use forward declaration in headers if possible instead of includesDavid Kalnischkies1-1/+2
2011-09-13merge with debian/experimentalDavid Kalnischkies1-4/+20
2011-09-13reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies1-1/+3
2011-08-15merged from lp:~mvo/apt/mvoMichael Vogt1-1/+17
2011-08-11follow the recommendation of cppcheck to make some method methods (scnr)David Kalnischkies1-1/+1
const and initial mostly Debug member values in the constructors
2011-08-11cppcheck complains about some possible speed improvements which could beDavid Kalnischkies1-2/+2
done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types.
2011-08-11* methods/mirror.cc:Michael Vogt1-1/+17
- include the architecture(s) in the query string as well so that the server can make better decisions
2011-06-07append the dist (e.g. sid, wheezy) as a query string whenMichael Vogt1-0/+5
asking for a suitable mirror
2011-06-07* methods/mirror.cc:Michael Vogt1-2/+12
- ignore lines starting with "#" in the mirror file - ignore non http urls in the mirrors
2011-03-24methods/mirror.cc: raise error if the mirror file can not be readMichael Vogt1-0/+7
2011-03-24do not crash if the mirror file fails to downloadMichael Vogt1-2/+5
2011-03-24merge fix from Matt Zimmerman, many thanks (LP: #741098)Michael Vogt1-1/+3
2011-03-14methods/mirror.cc: randomize only based on hostnameMichael Vogt1-4/+15
2011-03-14methods/mirror.cc: init random seed at startupMichael Vogt1-1/+3
2011-03-14randomize mirror list to ensure more even loadMichael Vogt1-0/+30
2011-03-14* mirror method:Michael Vogt1-0/+4
- when downloading data, show the mirror being used
2011-03-11methods/mirror.cc: improve debug output and fix selecting the next mirrorMichael Vogt1-4/+9
2010-06-09fix compiler warning in the new mirror codeDavid Kalnischkies1-11/+16
2010-06-02methods/mirror.cc: debug improvementsMichael Vogt1-2/+9
2010-06-02implement Fail-Ignore bool in FetchItem that tells the method that a failure ↵Michael Vogt1-12/+11
of this item is ok and does not need to be tried on all mirrors
2010-06-02methods/mirror.cc: simplify uri.startswith()Michael Vogt1-1/+1
2010-06-02methods/mirrors.cc: make cycle through the mirrors work properlyMichael Vogt1-15/+40
2010-06-02methods/mirror.cc: remove Acquire::Mirror::RefreshInterval (not really useful)Michael Vogt1-22/+0
2010-06-02improve error message if mirror method failsMichael Vogt1-6/+8
2010-06-02methods/mirror.cc: on fail try the next mirrorMichael Vogt1-1/+11
2010-06-02* apt-pkg/deb/dpkgpm.cc:Michael Vogt1-7/+23
- add missing include * methods/mirror.{cc,h}: - add SelectNextMirror() and InitMirrors() functions - read all mirrors into the AllMirrors vector
2009-03-19* methods/mirror.cc:Michael Vogt1-2/+16
- when download the mirror file and the server is down, return a propper error message (LP: #278635)
2007-11-28* methods/mirror.{cc,h}:Michael Vogt1-59/+93
- only update mirror list on IndexFile updates
2007-11-28methods/mirror.{cc,h}:Michael Vogt1-59/+93
- improve the mirror method so that it only updates the mirror list from the server if we get new indexfiles - code cleanup
2007-02-06* merged the apt--mirror branchMichael Vogt1-0/+282
2007-02-06* apt-pkg/acquire-item.cc:Michael Vogt1-0/+1
- default to "/usr/lib/apt/apt-report-mirror-failure" * cmdline/apt-report-mirror-failure: - no default comit url for now * debian/rules: - move apt-report-mirror-failure into /usr/lib/apt * doc/examples/configure-index: - more documentation * methods/mirror.cc: - updated TODO
2007-02-05* apt-pkg/acquire-item.cc:Michael Vogt1-3/+6
- use FailReason in pkgAcquire::Item::Failed when available * methods/mirror.cc: - move some debug output into if(Debug)
2007-02-05* get rid of magic mirrorMichael Vogt1-16/+46
2007-02-05* use pkgAcqMethod::FailReason() for consistent error reportingMichael Vogt1-9/+3
2007-02-01* commited the latest mirror failure detection codeMichael Vogt1-41/+4
2007-01-24make the mirror failures actually produce a error messageMichael Vogt1-11/+35
2007-01-17* mirror-failure.py: example mirror failure cgiMichael Vogt1-0/+6
* methods/mirror.cc: prepare for the failure submit