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

From: <poeml_at_mirrorbrain.org>
Date: Wed, 05 May 2010 17:47:45 -0000
Author: poeml
Date: Wed May  5 19:47:44 2010
New Revision: 8048

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8048&view=rev
Log:
mod_mirrorbrain:
- If a metalink or meta4 response is transparently negotiated, and there is no
  known mirror for a file, there is no need to respond with a 404; instead, the
  file is delivered directly.

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=8048&r1=8047&r2=8048&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c (original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c Wed May  5 19:47:44 2010
_at_@ -1577,10 +1577,15 @@
                 break;
             case META4:
             case METALINK:
-                debugLog(r, cfg, "would have to send empty metalink... -> 404");
-                ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, 
-                        "[mod_mirrorbrain] Can't send metalink for %s (no mirrors)", filename);
-                return HTTP_NOT_FOUND;
+                if (meta_negotiated) {
+                    debugLog(r, cfg, "would have to send empty metalink... -> deliver directly");
+                    return DECLINED;
+                } else {
+                    debugLog(r, cfg, "would have to send empty metalink... -> 404");
+                    ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, 
+                            "[mod_mirrorbrain] Can't send metalink for %s (no mirrors)", filename);
+                    return HTTP_NOT_FOUND;
+                }
             default:
                 /* deliver the file ourselves */
                 debugLog(r, cfg, "have to deliver directly");
_at_@ -2866,7 +2871,7 @@
 
     if (!chosen) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, 
-            "[mod_mirrorbrain] could not chose a server. Shouldn't have happened.");
+            "[mod_mirrorbrain] could not choose a server. Shouldn't have happened.");
         return DECLINED;
     }
     debugLog(r, cfg, "Chose server %s", chosen->identifier);




_______________________________________________
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 Wed May 05 2010 - 17:47:46 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT