httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Sat, 10 Apr 2004 18:40:53 GMT
nd          2004/04/10 11:40:53

  Modified:    server   core.c
  Log:
  "ErrorDocument default" changes broke inheritance. consider:
  
  <Directory /foo>
  ErrorDocument 404 blah
  </Directory>
  <DIrectory /foo/bar>
  ErrorDocument 500 boo
  # 404 is now fallen back to default
  </Directory>
  
  This patch solves the problem.
  
  Revision  Changes    Path
  1.273     +11 -2     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.272
  retrieving revision 1.273
  diff -u -u -r1.272 -r1.273
  --- core.c	10 Apr 2004 13:57:39 -0000	1.272
  +++ core.c	10 Apr 2004 18:40:53 -0000	1.273
  @@ -82,6 +82,9 @@
   AP_DECLARE_DATA ap_filter_rec_t *ap_net_time_filter_handle;
   AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle;
   
  +/* magic pointer for ErrorDocument xxx "default" */
  +static char errordocument_default;
  +
   static void *create_core_dir_config(apr_pool_t *a, char *dir)
   {
       core_dir_config *conf;
  @@ -271,7 +274,9 @@
                  sizeof(*conf->response_code_strings) * RESPONSE_CODES);
   
           for (i = 0; i < RESPONSE_CODES; ++i) {
  -            conf->response_code_strings[i] = new->response_code_strings[i];
  +            if (new->response_code_strings[i] != NULL) {
  +                conf->response_code_strings[i] = new->response_code_strings[i];
  +            }
           }
       }
       /* Otherwise we simply use the base->response_code_strings array
  @@ -695,6 +700,10 @@
   	return NULL;
       }
   
  +    if (dirconf->response_code_strings[error_index] == &errordocument_default) {
  +        return NULL;
  +    }
  +
       return dirconf->response_code_strings[error_index];
   }
   
  @@ -1180,7 +1189,7 @@
               /* special case: ErrorDocument 404 default restores the
                * canned server error response
                */
  -            conf->response_code_strings[index_number] = NULL;
  +            conf->response_code_strings[index_number] = &errordocument_default;
           }
           else {
               /* hack. Prefix a " if it is a msg; as that is what
  
  
  

Mime
View raw message