httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@hyperreal.org
Subject cvs commit: apache-1.3/src/modules/standard mod_autoindex.c
Date Mon, 31 Aug 1998 01:18:56 GMT
coar        98/08/30 18:18:55

  Modified:    htdocs/manual new_features_1_3.html upgrading_to_1_3.html
               htdocs/manual/mod mod_autoindex.html
               src      CHANGES
               src/modules/standard mod_autoindex.c
  Log:
  	Clean up mod_autoindex's storage of the IndexOptions settings.
  	They are per-directory, not per-filename, so keeping them in
  	an array is confusing and pointless.  They're now stored in an
  	int in the module config record.  Also (finally!) fix the
  	FancyIndexing directive so it gets merged into any IndexOptions
  	settings for the current directory, rather than replacing them.
  
  Revision  Changes    Path
  1.68      +6 -0      apache-1.3/htdocs/manual/new_features_1_3.html
  
  Index: new_features_1_3.html
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/htdocs/manual/new_features_1_3.html,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- new_features_1_3.html	1998/07/20 00:18:18	1.67
  +++ new_features_1_3.html	1998/08/31 01:18:45	1.68
  @@ -268,6 +268,12 @@
           height and width attributes to the <CODE>&lt;IMG&gt;</CODE>
tag in
           directory listings.
   
  +    <LI>The <A HREF="mod/mod_autoindex.html#fancyindexing"
  +        ><SAMP>FancyIndexing</SAMP></A> directive now correctly has
  +        the same impact as <SAMP>IndexOptions&nbsp;FancyIndexing</SAMP>
  +	without replacing the effect of any existing <SAMP>IndexOptions</SAMP>
  +	directive.
  +
       </UL>
   
   <DT><STRONG>Less Buffering of CGI Script Output</STRONG>
  
  
  
  1.28      +4 -0      apache-1.3/htdocs/manual/upgrading_to_1_3.html
  
  Index: upgrading_to_1_3.html
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/htdocs/manual/upgrading_to_1_3.html,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- upgrading_to_1_3.html	1998/07/04 15:10:50	1.27
  +++ upgrading_to_1_3.html	1998/08/31 01:18:45	1.28
  @@ -72,6 +72,10 @@
   <H3>Run-Time Configuration Changes</H3>
   
   <UL>
  +  <LI>Standalone <STRONG><SAMP>FancyIndexing</SAMP></STRONG>
directives
  +    are now combined with the settings of any <SAMP>IndexOptions</SAMP>
  +    directive already in effect, rather than replacing them.
  +  </LI>
     <LI><STRONG><SAMP>AuthName</SAMP> strings will need to be quoted</STRONG>
       in <SAMP>.htaccess</SAMP> or server configuration files if they contain
       blank characters (like spaces). For example, if you use
  
  
  
  1.20      +6 -2      apache-1.3/htdocs/manual/mod/mod_autoindex.html
  
  Index: mod_autoindex.html
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/mod_autoindex.html,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_autoindex.html	1998/05/20 14:12:54	1.19
  +++ mod_autoindex.html	1998/08/31 01:18:48	1.20
  @@ -373,10 +373,14 @@
   preference.
   </P>
   <BLOCKQUOTE>
  - <STRONG>Note that the <SAMP>FancyIndexing</SAMP> and
  + <STRONG>Note that in versions of Apache prior to 1.3.2, the
  + <SAMP>FancyIndexing</SAMP> and
    <SAMP>IndexOptions</SAMP> directives will override each other. You
    should use <SAMP>IndexOptions&nbsp;FancyIndexing</SAMP> in preference
  - to the standalone <SAMP>FancyIndexing</SAMP> directive.</STRONG>
  + to the standalone <SAMP>FancyIndexing</SAMP> directive.
  + As of Apache 1.3.2, a standalone <SAMP>FancyIndexing</SAMP> directive
  + is combined with any <SAMP>IndexOptions</SAMP> directive already
  + specified for the current scope.</STRONG>
   </BLOCKQUOTE>
   <HR>
   
  
  
  
  1.1040    +5 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1039
  retrieving revision 1.1040
  diff -u -r1.1039 -r1.1040
  --- CHANGES	1998/08/28 11:27:19	1.1039
  +++ CHANGES	1998/08/31 01:18:51	1.1040
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.2
   
  +  *) Simplify handling of IndexOptions in mod_autoindex -- and BTW
  +     cause the standalone FancyIndexing directive to logically OR
  +     into any existing IndexOptions settings rather than wiping
  +     them out.  [Ken Coar]
  +
     *) Changes in ftp proxy: make URL parsing simpler by using the
        parsed_uri stuff.
        + Add display of the "current directory" in cases where it's
  
  
  
  1.90      +28 -39    apache-1.3/src/modules/standard/mod_autoindex.c
  
  Index: mod_autoindex.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- mod_autoindex.c	1998/08/29 18:27:10	1.89
  +++ mod_autoindex.c	1998/08/31 01:18:53	1.90
  @@ -121,11 +121,12 @@
   typedef struct autoindex_config_struct {
   
       char *default_icon;
  +    int opts;
       int icon_width;
       int icon_height;
   
       array_header *icon_list, *alt_list, *desc_list, *ign_list;
  -    array_header *hdr_list, *rdme_list, *opts_list;
  +    array_header *hdr_list, *rdme_list;
   
   } autoindex_config_rec;
   
  @@ -271,17 +272,20 @@
       return NULL;
   }
   
  -
  -static const char *add_opts_int(cmd_parms *cmd, void *d, int opts)
  -{
  -    push_item(((autoindex_config_rec *) d)->opts_list, (char *) (long) opts,
  -	      NULL, cmd->path, NULL);
  -    return NULL;
  -}
  -
  +/* A legacy directive, FancyIndexing is superseded by the IndexOptions
  + * keyword.  But for compatibility..
  + */
   static const char *fancy_indexing(cmd_parms *cmd, void *d, int arg)
   {
  -    return add_opts_int(cmd, d, arg ? FANCY_INDEXING : 0);
  +    int curopts;
  +    int newopts;
  +    autoindex_config_rec *cfg;
  +
  +    cfg = (autoindex_config_rec *) d;
  +    curopts = cfg->opts;
  +    newopts = (arg ? (curopts | FANCY_INDEXING) : (curopts & !FANCY_INDEXING));
  +    cfg->opts = newopts;
  +    return NULL;
   }
   
   static const char *add_opts(cmd_parms *cmd, void *d, const char *optstr)
  @@ -335,7 +339,8 @@
   	    return "Invalid directory indexing option";
   	}
       }
  -    return add_opts_int(cmd, d, opts);
  +    d_cfg->opts = opts;
  +    return NULL;
   }
   
   #define DIR_CMD_PERMS OR_INDEXES
  @@ -383,7 +388,7 @@
       new->ign_list = ap_make_array(p, 4, sizeof(struct item));
       new->hdr_list = ap_make_array(p, 4, sizeof(struct item));
       new->rdme_list = ap_make_array(p, 4, sizeof(struct item));
  -    new->opts_list = ap_make_array(p, 4, sizeof(struct item));
  +    new->opts = 0;
   
       return (void *) new;
   }
  @@ -406,7 +411,7 @@
       new->desc_list = ap_append_arrays(p, add->desc_list, base->desc_list);
       new->icon_list = ap_append_arrays(p, add->icon_list, base->icon_list);
       new->rdme_list = ap_append_arrays(p, add->rdme_list, base->rdme_list);
  -    new->opts_list = ap_append_arrays(p, add->opts_list, base->opts_list);
  +    new->opts = add->opts;
   
       return new;
   }
  @@ -482,7 +487,7 @@
   #define find_header(d,p) find_item(p,d->hdr_list,0)
   #define find_readme(d,p) find_item(p,d->rdme_list,0)
   
  -static char *find_default_icon(autoindex_config_rec * d, char *bogus_name)
  +static char *find_default_icon(autoindex_config_rec *d, char *bogus_name)
   {
       request_rec r;
   
  @@ -497,7 +502,7 @@
       return find_item(&r, d->icon_list, 1);
   }
   
  -static int ignore_entry(autoindex_config_rec * d, char *path)
  +static int ignore_entry(autoindex_config_rec *d, char *path)
   {
       array_header *list = d->ign_list;
       struct item *items = (struct item *) list->elts;
  @@ -542,23 +547,6 @@
       return 0;
   }
   
  -static int find_opts(autoindex_config_rec * d, request_rec *r)
  -{
  -    char *path = r->filename;
  -    array_header *list = d->opts_list;
  -    struct item *items = (struct item *) list->elts;
  -    int i;
  -
  -    for (i = 0; i < list->nelts; ++i) {
  -	struct item *p = &items[i];
  -
  -	if (!ap_strcmp_match(path, p->apply_path)) {
  -	    return (int) (long) p->type;
  -	}
  -    }
  -    return 0;
  -}
  -
   /*****************************************************************
    *
    * Actually generating output
  @@ -581,7 +569,7 @@
   
       cfg = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config,
   							&autoindex_module);
  -    autoindex_opts = find_opts(cfg, r);
  +    autoindex_opts = cfg->opts;
       /* XXX: this is a load of crap, it needs to do a full sub_req_lookup_uri */
       fn = ap_make_full_path(r->pool, name, readme_fname);
       fn = ap_pstrcat(r->pool, fn, ".html", NULL);
  @@ -714,7 +702,7 @@
   }
   
   static struct ent *make_autoindex_entry(char *name, int autoindex_opts,
  -					autoindex_config_rec * d,
  +					autoindex_config_rec *d,
   					request_rec *r, char keyid,
   					char direction)
   {
  @@ -780,7 +768,7 @@
       return (p);
   }
   
  -static char *terminate_description(autoindex_config_rec * d, char *desc,
  +static char *terminate_description(autoindex_config_rec *d, char *desc,
   				   int autoindex_opts)
   {
       int maxsize = 23;
  @@ -850,8 +838,8 @@
   }
   
   static void output_directories(struct ent **ar, int n,
  -			       autoindex_config_rec * d, request_rec *r,
  -			     int autoindex_opts, char keyid, char direction)
  +			       autoindex_config_rec *d, request_rec *r,
  +			       int autoindex_opts, char keyid, char direction)
   {
       int x;
       char *name = r->uri;
  @@ -1055,7 +1043,8 @@
   }
   
   
  -static int index_directory(request_rec *r, autoindex_config_rec * autoindex_conf)
  +static int index_directory(request_rec *r,
  +			   autoindex_config_rec *autoindex_conf)
   {
       char *title_name = ap_escape_html(r->pool, r->uri);
       char *title_endp;
  @@ -1068,7 +1057,7 @@
       struct ent **ar = NULL;
       char *tmp;
       const char *qstring;
  -    int autoindex_opts = find_opts(autoindex_conf, r);
  +    int autoindex_opts = autoindex_conf->opts;
       char keyid;
       char direction;
   
  
  
  

Mime
View raw message