On Wed, Jun 15, 2011 at 04:25:07AM +0400, Konstantin Kolinko wrote:

> Looking at the mirrors.cgi script at
> /site/trunk/content/dyn/mirrors/mirrors.cgi  at the above link, I
> think there is a bug there.
> 
> There is the following code fragment in parse_mirrors():
> 
>   # Check if the requested Preferred mirror is in the list
>   # Note the user-requested mirror doesn't have a trailing-slash
>   prefmir=None
>   if preferred:
>     for mir in mirrors:
>       if mir[2][:-1]==preferred:
>         prefmir=mir
>         break
> 

> Index: mirrors.cgi
> ===================================================================
> --- mirrors.cgi       (revision 1135864)
> +++ mirrors.cgi       (working copy)
> @@ -91,11 +91,11 @@
>        break
> 
>    # Check if the requested Preferred mirror is in the list
> -  # Note the user-requested mirror doesn't have a trailing-slash
> +  # Note the user-requested mirror may have no trailing-slash
>    prefmir=None
>    if preferred:
>      for mir in mirrors:
> -      if mir[2][:-1]==preferred:
> +      if mir[2].startswith(preferred):
>          prefmir=mir
>          break
>    # Otherwise pick a preferred mirror from our country

I have patched mirrors.cgi, and initial testing suggests that it has had 
desired effect.  

"Patch submitted by Konstantin Kolinko @gmail.com  --  Message-ID: 
<BANLkTinfnzKREsjVMudeKt4zUZiF=9z...@mail.gmail.com>"

Sending        x1/www/www.apache.org/dyn/mirrors/mirrors.cgi
Transmitting file data .
Committed revision 790972.


I have also made sure it has been applied to the EU, and US mirrors.  So it 
should be live for all now. 

Thanks for this. 

-- 

Cheers,
Tony


---------------------------------------
Tony Stevenson

t...@pc-tony.com  //  pct...@apache.org
t...@caret.cam.ac.uk

http://blog.pc-tony.com

GPG - 1024D/51047D66
--------------------------------------"

Attachment: signature.asc
Description: Digital signature

Reply via email to