martin      99/10/23 14:20:17

  Modified:    src      CHANGES
               src/modules/standard mod_speling.c
  Log:
  mod_speling runs in 2.0-dev now: a bug in (linux?) readdir_r handling and
  interface adaption to APR functions did it. [Martin Kraemer]
  
  Revision  Changes    Path
  1.12      +3 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CHANGES   1999/10/13 02:41:06     1.11
  +++ CHANGES   1999/10/23 21:20:15     1.12
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0-dev
   
  +  *) mod_speling runs in 2.0-dev now: a bug in readdir_r handling and
  +     interface adaption to APR functions did it. [Martin Kraemer]
  +
     *) Support DSOs properly on 32-bit HP-UX 11.0
        [Dilip Khandekar <[EMAIL PROTECTED]>]
   
  
  
  
  1.6       +10 -15    apache-2.0/src/modules/standard/mod_speling.c
  
  Index: mod_speling.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/src/modules/standard/mod_speling.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mod_speling.c     1999/10/22 15:50:12     1.5
  +++ mod_speling.c     1999/10/23 21:20:16     1.6
  @@ -61,7 +61,6 @@
   #include "http_config.h"
   #include "http_log.h"
   #include "apr_file_io.h"
  -#include "../../lib/apr/misc/unix/misc.h"
   
   /* mod_speling.c - by Alexei Kosut <[EMAIL PROTECTED]> June, 1996
    *
  @@ -229,7 +228,7 @@
   static int check_speling(request_rec *r)
   {
       spconfig *cfg;
  -    char *good, *bad, *postgood, *url;
  +    char *good, *bad, *postgood, *url, *fname;
       int filoc, dotloc, urlen, pglen;
       ap_array_header_t *candidates = NULL;
       ap_dir_t          *dir;
  @@ -302,17 +301,14 @@
           dotloc = strlen(bad);
       }
   
  -    while (ap_readdir(dir) == APR_SUCCESS) {
  +    /* NOTE: ap_get_dir_filename() fills fname with a ap_palloc()ed copy
  +     * of the found directory name already. We don't need to copy it.
  +     * @@@: Copying *ALL* found file names is wasted energy (and memory)!
  +     */
  +    while (ap_readdir(dir) == APR_SUCCESS &&
  +        ap_get_dir_filename(&fname, dir) == APR_SUCCESS) {
           sp_reason q;
  -     char *fname;
  -        ap_status_t ok; 
  -
  -        ok = ap_get_dir_filename(&fname, dir);
   
  -/*@@*/
  -        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, APR_SUCCESS,
  -               r, __FILE__": Check_Speling `%s' in `%s'", r->filename, good, 
ok==APR_SUCCESS ? fname : "ERROR");
  -/*@@*/
           /*
            * If we end up with a "fixed" URL which is identical to the
            * requested one, we must have found a broken symlink or some such.
  @@ -331,7 +327,7 @@
               misspelled_file *sp_new;
   
            sp_new = (misspelled_file *) ap_push_array(candidates);
  -            sp_new->name = ap_pstrdup(r->pool, fname);
  +            sp_new->name = fname;
               sp_new->quality = SP_MISCAPITALIZED;
           }
   
  @@ -343,7 +339,7 @@
               misspelled_file *sp_new;
   
            sp_new = (misspelled_file *) ap_push_array(candidates);
  -            sp_new->name = ap_pstrdup(r->pool, fname);
  +            sp_new->name = fname;
               sp_new->quality = q;
           }
   
  @@ -389,13 +385,12 @@
                   misspelled_file *sp_new;
   
                sp_new = (misspelled_file *) ap_push_array(candidates);
  -                sp_new->name = ap_pstrdup(r->pool, fname);
  +                sp_new->name = fname;
                   sp_new->quality = SP_VERYDIFFERENT;
               }
   #endif
           }
       }
  -
       ap_closedir(dir);
   
       if (candidates->nelts != 0) {
  
  
  

Reply via email to