mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Reuse default HTTP transport options.
This commit is contained in:
+4
-4
@@ -45,6 +45,9 @@ type downloadTask struct {
|
|||||||
// NewDownloader creates new instance of Downloader which specified number
|
// NewDownloader creates new instance of Downloader which specified number
|
||||||
// of threads and download limit in bytes/sec
|
// of threads and download limit in bytes/sec
|
||||||
func NewDownloader(threads int, downLimit int64, progress aptly.Progress) aptly.Downloader {
|
func NewDownloader(threads int, downLimit int64, progress aptly.Progress) aptly.Downloader {
|
||||||
|
transport := *http.DefaultTransport.(*http.Transport)
|
||||||
|
transport.DisableCompression = true
|
||||||
|
|
||||||
downloader := &downloaderImpl{
|
downloader := &downloaderImpl{
|
||||||
queue: make(chan *downloadTask, 1000),
|
queue: make(chan *downloadTask, 1000),
|
||||||
stop: make(chan bool),
|
stop: make(chan bool),
|
||||||
@@ -54,10 +57,7 @@ func NewDownloader(threads int, downLimit int64, progress aptly.Progress) aptly.
|
|||||||
threads: threads,
|
threads: threads,
|
||||||
progress: progress,
|
progress: progress,
|
||||||
client: &http.Client{
|
client: &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &transport,
|
||||||
DisableCompression: true,
|
|
||||||
Proxy: http.ProxyFromEnvironment,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user