httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_negotiation.c
Date Tue, 01 Jan 2002 19:01:40 GMT
wrowe       02/01/01 11:01:39

  Modified:    modules/mappers mod_negotiation.c
  Log:
    Thanks Mr. Trawick, backtraces can be very enlightening.
  
    This fixes two bugs, the segfault when researching index numbers,
    and another.  We don't hint anywhere that LanguagePriority is a
    cumulative setting, in fact the syntax doesn't suggest so either.
    Merges are always slow, there is no reason to make this even slower.
  
    So the patch has the LanguagePriority directive override any existing
    LanguagePriority list from an earlier container.
  
  Revision  Changes    Path
  1.88      +6 -5      httpd-2.0/modules/mappers/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_negotiation.c,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- mod_negotiation.c	30 Dec 2001 14:30:44 -0000	1.87
  +++ mod_negotiation.c	1 Jan 2002 19:01:39 -0000	1.88
  @@ -119,8 +119,8 @@
       /* give priority to the config in the subdirectory */
       new->forcelangpriority = add->forcelangpriority ? add->forcelangpriority
                                                       : base->forcelangpriority;
  -    new->language_priority = apr_array_append(p, add->language_priority,
  -                                           base->language_priority);
  +    new->language_priority = add->language_priority ? add->language_priority 
  +                                                    : base->language_priority;
       return new;
   }
   
  @@ -1367,19 +1367,20 @@
   
   static int find_lang_index(apr_array_header_t *accept_langs, char *lang)
   {
  -    accept_rec *accs;
  +    const char **alang;
       int i;
   
       if (!lang || !accept_langs) {
           return -1;
       }
   
  -    accs = (accept_rec *) accept_langs->elts;
  +    alang = (const char **) accept_langs->elts;
   
       for (i = 0; i < accept_langs->nelts; ++i) {
  -        if (!strncmp(lang, accs[i].name, strlen(accs[i].name))) {
  +        if (!strncmp(lang, *alang, strlen(*alang))) {
               return i;
           }
  +        alang += (accept_langs->elt_size / sizeof(char*));
       }
   
       return -1;
  
  
  

Mime
View raw message