Duncan (my “another mentor” in my Google Summer of Code project), proposed to me to try another approach to solve the failover concept within libzypp library. This time, I will try to create “another” MediaHandler class than will use an external program (aria2c) to download files from download.opensuse.org server. Thus, it will not be required to download metalink file, parse it and download selected package: aria2c will do all of this for us 🙂
Extracted from aria2c webpage:
aria2 is a utility for downloading files. The supported protocols are HTTP(S), FTP, BitTorrent (DHT, PEX, MSE/PE), and Metalink. It has a powerful segmented downloading ability, downloading a file from multiple sources and multiple protocols and utilizing your download bandwidth to the maximum. It even supports downloading a file from HTTP(S)/FTP and BitTorrent at the same time, while the data downloaded from HTTP(S)/FTP is uploaded to the BitTorrent swarm.
Using Metalink’s chunk checksums, aria2 automatically validates chunks of data while downloading a file like BitTorrent.