mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-10-21 10:58:23 +00:00
Print redirects being followed, drop mirror.yandex.ru.
Use CDN-backed Debian mirror to make tests run faster hopefully for everyone. Redirects might be important to know what exactly is going on when items are being downloaded.
This commit is contained in:
1 parent
021b6f694b
commit
26098f6c8d
52 files changed
+222
-203
No files matched your search
@@ -53,6 +53,7 @@ func NewDownloader(downLimit int64, maxTries int, progress aptly.Progress) aptly
|
||||
},
|
||||
}
|
||||
|
||||
downloader.client.CheckRedirect = downloader.checkRedirect
|
||||
if downLimit > 0 {
|
||||
downloader.aggWriter = flowrate.NewWriter(progress, downLimit)
|
||||
} else {
|
||||
@@ -62,6 +63,14 @@ func NewDownloader(downLimit int64, maxTries int, progress aptly.Progress) aptly
|
||||
return downloader
|
||||
}
|
||||
|
||||
func (downloader *downloaderImpl) checkRedirect(req *http.Request, via []*http.Request) error {
|
||||
if downloader.progress != nil {
|
||||
downloader.progress.Printf("Following redirect to %s...\n", req.URL)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetProgress returns Progress object
|
||||
func (downloader *downloaderImpl) GetProgress() aptly.Progress {
|
||||
return downloader.progress
|
||||
|
||||
Reference in new issue
Block a user