Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 330611

Summary: mirrorselect should verify that the file downloaded in deep mode downloaded correctly
Product: Portage Development Reporter: Soren Harward <stharward>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Soren Harward 2010-07-31 13:05:36 UTC
Running mirrorselect in deep mode causes it to download a 100k test file from the server.  However, mirrorselect never checks if the file was downloaded correctly.  So if an HTTP server is having problems and returns an error page that's only 1k instead of the file that is 100k, mirrorselect is going to think that the server is really fast and put it at the head of the list, instead of correctly realizing that the server is having problems and should be dropped from the results.

I suggest checking the result from urllib to see if the file was reported as downloaded correctly, and then checking to see if the correct number of bytes were received; if you wanted to get really thorough, you could also check if the file downloaded matched an MD5 or SHA1 checksum.
Comment 1 Christian Ruppert (idl0r) gentoo-dev 2010-08-02 17:07:36 UTC
Thanks!
Should be fixed in app-portage/mirrorselect-2.1.0-r2, please test :)