manjaro / pacman-mirrors

This repo has been archived. Our code is now hosted at
https://gitlab.manjaro.org
GNU General Public License v3.0
25 stars 16 forks source link

Use a different method to rank mirrors #118

Closed cubanpit closed 6 years ago

cubanpit commented 6 years ago

Some users can't rank mirrors because ICMP packets are filtered on their network, is it possible to use a different method to rank mirrors? I do not know if an HTTP request with curl can do the job fairly. /bin/time --format=%E curl -s --head http://mirror.dacentec.com/manjaro/

philmmanjaro commented 6 years ago

@cubanpit I think this is a good idea. @fhdk: can you check and implement this suggestion?

fhdk commented 6 years ago

I can look at it. But if memory serves no ping is used but a request for the state file.

fhdk commented 6 years ago

https://github.com/manjaro/pacman-mirrors/blob/9008486c8629976d0ebfdf4cfa92d39bd1e9366f/pacman_mirrors/functions/httpFn.py#L126-L128

fhdk commented 6 years ago

the online check is not using ping either but opens an url and checks the response.

https://github.com/manjaro/pacman-mirrors/blob/9008486c8629976d0ebfdf4cfa92d39bd1e9366f/pacman_mirrors/functions/httpFn.py#L163-L174

cubanpit commented 6 years ago

OK, sorry, I have read code without enough attention. So this functions appears unused: https://github.com/manjaro/pacman-mirrors/blob/d0168ecbbc90888a14fd80f2b165d6a3560f587a/pacman_mirrors/functions/httpFn.py#L177-L184

I have discovered the user reporting the problem uses a network behind a proxy, I have asked him to check if pacman-mirrors works fine when the proxy is set correctly system-wide.

fhdk commented 6 years ago

The ping_host() function is not used. The code was replaced in early stage of development. Just forgot about it - since I do not remove code unless I know the replacement works as expected.

cubanpit commented 6 years ago

Ok, everything works fine also behind a proxy. Sorry for the wrong bug report.