[mirrorbrain-commits] r8222 - /trunk/mod_mirrorbrain/mod_mirrorbrain.c

From: <poeml_at_mirrorbrain.org>
Date: Sat, 13 Nov 2010 21:02:35 -0000
Author: poeml
Date: Sat Nov 13 22:02:34 2010
New Revision: 8222

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8222&view=rev
Log:
mod_mirrorbrain:
- when serving a yum list, but no mirror is available (including fallback
  mirrors), send the URL of the redirector itself.

Modified:
    trunk/mod_mirrorbrain/mod_mirrorbrain.c

Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.c
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.c?rev=8222&r1=8221&r2=8222&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c (original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c Sat Nov 13 22:02:34 2010
_at_@ -3456,10 +3456,14 @@
         apr_array_header_t *topten = get_n_best_mirrors(r, 10, mirrors_same_prefix, mirrors_same_as, 
                                                          mirrors_same_country, mirrors_same_region, 
                                                          mirrors_elsewhere);
-        mirrorp = (mirror_entry_t **)topten->elts;
-        for (i = 0; i < topten->nelts; i++) {
-            mirror = mirrorp[i];
-            ap_rprintf(r, "%s%s/\n", mirror->baseurl, yum->dir);
+        if (topten->nelts > 0) {
+            mirrorp = (mirror_entry_t **)topten->elts;
+            for (i = 0; i < topten->nelts; i++) {
+                mirror = mirrorp[i];
+                ap_rprintf(r, "%s%s/\n", mirror->baseurl, yum->dir);
+            }
+        } else {
+            ap_rprintf(r, "http://%s/%s/\n", r->hostname, yum->dir);
         }
         setenv_give(r, "yumlist");
         return OK;




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sat Nov 13 2010 - 21:02:36 GMT

This archive was generated by hypermail 2.3.0 : Sat Nov 13 2010 - 21:17:26 GMT