[mirrorbrain-commits] [opensuse-svn] r6656 - trunk/tools/download-redirector-v2/mod_mirrorbrain

From: Novell Forge SVN <noreply_at_novell.com>
Date: Mon, 2 Mar 2009 10:36:58 -0700 (MST)
Author: poeml
Date: 2009-03-02 10:36:55 -0700 (Mon, 02 Mar 2009)
New Revision: 6656

Modified:
   trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c
Log:
mod_mirrorbrain:
- add broken URLs to the top of metalinks for testing purposes. Clients can
  trigger this with additional HTTP request header "X-Broken-Mirrors: true"


Modified: trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c
===================================================================
--- trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c	2009-03-02 16:49:28 UTC (rev 6655)
+++ trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c	2009-03-02 17:36:55 UTC (rev 6656)
@@ -1609,6 +1609,40 @@
          * we'll decrement it for each mirror by one, until zero is reached */
         int pref = 101;
 
+
+        /* insert broken mirrors at the top, for failover testing? */
+        if(apr_table_get(r->headers_in, "X-Broken-Mirrors")) {
+            debugLog(r, cfg, "Client sent X-Broken-Mirrors header -- adding broken mirrors");
+            ap_rprintf(r, "\n      <!-- Broken mirrors for testing: -->\n");
+            /* hostname does not resolve */
+            ap_rprintf(r, "      <url type=\"http\" location=\"de\" preference=\"%d\">"
+                          "http://doesnotexist/%s</url>\n",
+                       --pref,
+                       filename);
+            /* 404 Not found */
+            ap_rprintf(r, "      <url type=\"http\" location=\"de\" preference=\"%d\">"
+                          "http://www.poeml.de/nonexisting_file_for_libzypp</url>\n",
+                       --pref);
+            /* Connection refused */
+            ap_rprintf(r, "      <url type=\"http\" location=\"de\" preference=\"%d\">"
+                          "http://www.poeml.de:83/nonexisting_file_for_libzypp</url>\n",
+                       --pref);
+            /* A totally obscure reply ("server busy") */
+            ap_rprintf(r, "      <url type=\"http\" location=\"de\" preference=\"%d\">"
+                          "http://ftp.opensuse.org:21/foobar</url>\n",
+                       --pref);
+            /* 403 Forbidden */
+            ap_rprintf(r, "      <url type=\"http\" location=\"de\" preference=\"%d\">"
+                          "http://download.opensuse.org/error/</url>\n",
+                       --pref);
+            /* Times out */
+            /* Maybe we should leave this one commented, so the timeouts don't hinder initial
+             * testing and progress too much - but let's try */
+            ap_rprintf(r, "      <url type=\"http\" location=\"de\" preference=\"%d\">"
+                          "http://widehat.opensuse.org:22/foobar</url>\n",
+                       --pref);
+        }
+
         ap_rprintf(r, "\n      <!-- Mirrors in the same network (%s): -->\n",
                    (strcmp(prefix, "--") == 0) ? "unknown" : prefix);
         mirrorp = (mirror_entry_t **)mirrors_same_prefix->elts;

_______________________________________________
Opensuse-svn mailing list
Opensuse-svn_at_forge.novell.com
http://forge.novell.com/mailman/listinfo/opensuse-svn


_______________________________________________
mirrorbrain-commits mailing list

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 2009-03-02Z17:37:26

This archive was generated by hypermail 2.2.0 : 2009-07-10Z19:18:12 GMT