[mirrorbrain-commits] r7878 - in /trunk: docs/installation/ mod_mirrorbrain/

From: <poeml_at_mirrorbrain.org>
Date: Sat, 28 Nov 2009 16:12:51 -0000
Author: poeml
Date: Sat Nov 28 17:12:50 2009
New Revision: 7878

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7878&view=rev
Log:
mod_mirrorbrain:
- the MirrorBrainHandleDirectoryIndexLocally directive was never actually
  useful, because we never did (and could) redirect to directory listings. For
  one, a listing might not be available at each URL that we might redirect to.
  What's more, since the database only stores file paths and not directories, we
  can't actually look up directories. Thus, the directive is now removed, and a
  warning issued where it is still found in the config.

Modified:
    trunk/docs/installation/debian.rst
    trunk/docs/installation/source.rst
    trunk/mod_mirrorbrain/mod_mirrorbrain.c
    trunk/mod_mirrorbrain/mod_mirrorbrain.conf

Modified: trunk/docs/installation/debian.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/installation/debian.rst?rev=7878&r1=7877&r2=7878&view=diff
==============================================================================
--- trunk/docs/installation/debian.rst (original)
+++ trunk/docs/installation/debian.rst Sat Nov 28 17:12:50 2009
@@ -280,7 +280,6 @@
        FormGET On
        MirrorBrainHandleHEADRequestLocally Off
        MirrorBrainMinSize 2048
-       MirrorBrainHandleDirectoryIndexLocally On
        MirrorBrainExcludeUserAgent rpm/4.4.2*
        MirrorBrainExcludeUserAgent *APT-HTTP*
        MirrorBrainExcludeMimeType application/pgp-keys

Modified: trunk/docs/installation/source.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/installation/source.rst?rev=7878&r1=7877&r2=7878&view=diff
==============================================================================
--- trunk/docs/installation/source.rst (original)
+++ trunk/docs/installation/source.rst Sat Nov 28 17:12:50 2009
@@ -281,7 +281,6 @@
               FormGET On
               MirrorBrainHandleHEADRequestLocally Off
               MirrorBrainMinSize 2048
-              MirrorBrainHandleDirectoryIndexLocally On
               MirrorBrainExcludeUserAgent rpm/4.4.2*
               MirrorBrainExcludeUserAgent *APT-HTTP*
               MirrorBrainExcludeMimeType application/pgp-keys

Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.c
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.c?rev=7878&r1=7877&r2=7878&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c (original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c Sat Nov 28 17:12:50 2009
@@ -137,7 +137,6 @@
     int engine_on;
     int debug;
     int min_size;
-    int handle_dirindex_locally;
     int handle_headrequest_locally;
     const char *mirror_base;
     apr_array_header_t *exclude_mime;
@@ -269,7 +268,6 @@
     new->engine_on                  = UNSET;
     new->debug                      = UNSET;
     new->min_size                   = DEFAULT_MIN_MIRROR_SIZE;
-    new->handle_dirindex_locally    = UNSET;
     new->handle_headrequest_locally = 0;
     new->mirror_base = NULL;
     new->exclude_mime = apr_array_make(p, 0, sizeof (char *));
@@ -294,7 +292,6 @@
     cfgMergeInt(engine_on);
     cfgMergeInt(debug);
     mrg->min_size = (add->min_size != DEFAULT_MIN_MIRROR_SIZE) ? add->min_size : base->min_size;
-    cfgMergeInt(handle_dirindex_locally);
     cfgMergeInt(handle_headrequest_locally);
     cfgMergeString(mirror_base);
     mrg->exclude_mime = apr_array_append(p, base->exclude_mime, add->exclude_mime);
@@ -431,8 +428,9 @@
 static const char *mb_cmd_handle_dirindex_locally(cmd_parms *cmd, 
                                                   void *config, int flag)
 {
-    mb_dir_conf *cfg = (mb_dir_conf *) config;
-    cfg->handle_dirindex_locally = flag;
+    ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL,
+                 "[mod_mirrorbrain] The MirrorBrainHandleDirectoryIndexLocally "
+                 "directive is obsolete. You can remove it from your config.");
     return NULL;
 }
 
@@ -684,15 +682,6 @@
         return DECLINED;
     }
 
-    /* do we redirect if the request is for directories? */
-    /* XXX should one actually respect all strings which are configured
-     * as DirectoryIndex ? */
-    if (cfg->handle_dirindex_locally && ap_strcasestr(r->uri, "index.html")) {
-        debugLog(r, cfg, "serving index.html locally "
-                "(MirrorBrainHandleDirectoryIndexLocally)");
-        return DECLINED;
-    }
-
 
     debugLog(r, cfg, "URI: '%s'", r->unparsed_uri);
     debugLog(r, cfg, "filename: '%s'", r->filename);
@@ -2101,7 +2090,7 @@
 
     AP_INIT_FLAG("MirrorBrainHandleDirectoryIndexLocally", mb_cmd_handle_dirindex_locally, NULL, 
                   OR_OPTIONS,
-                  "Set to On/Off to handle directory listings locally (don't redirect)"),
+                  "Obsolete directive. You can remove it from your config."),
     AP_INIT_FLAG("MirrorBrainHandleHEADRequestLocally", mb_cmd_handle_headrequest_locally, NULL, 
                   OR_OPTIONS,
                   "Set to On to handle HEAD requests locally (instead of redirecting "

Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.conf
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.conf?rev=7878&r1=7877&r2=7878&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.conf (original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.conf Sat Nov 28 17:12:50 2009
@@ -102,7 +102,7 @@
         #
         FormGET On
 
-        #Set to On/Off to handle HEAD requests locally (don't redirect)
+        #Set to On to handle HEAD requests locally, instead of redirecting them 
         MirrorBrainHandleHEADRequestLocally Off
 
         # Don't redirect for files smaller than 4096 bytes
@@ -126,9 +126,6 @@
         # MirrorBrainExcludeMimeType directive; or it might be even easier.
         MirrorBrainExcludeFileMask "\.(md5|sha1|asc)"
         
-        # Set to On/Off to handle directory listings locally (don't redirect)
-        MirrorBrainHandleDirectoryIndexLocally On
-
         # User-Agent to always exclude from redirecting (wildcards allowed)
         MirrorBrainExcludeUserAgent w3m/0.5.1
 




_______________________________________________
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 28 2009 - 16:12:52 GMT

This archive was generated by hypermail 2.2.0 : Sat Nov 28 2009 - 16:45:08 GMT