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/filters mod_include.c
Date Fri, 28 Dec 2001 17:12:20 GMT
wrowe       01/12/28 09:12:20

  Modified:    modules/filters mod_include.c
  Log:
    Context mustn't be transformed in the insert_filters hook, it merely
    provides a point to insert filters already determined.  We can't wait
    for the insert_filters phase to 'redetermine' such things.
  
    Everything we are doing here can reliably occur in the fixup phase,
    after the types phase has completed.
  
  Revision  Changes    Path
  1.173     +21 -20    httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.172
  retrieving revision 1.173
  diff -u -r1.172 -r1.173
  --- mod_include.c	2001/12/28 17:09:52	1.172
  +++ mod_include.c	2001/12/28 17:12:20	1.173
  @@ -3190,7 +3190,7 @@
       {NULL}
   };
   
  -static int xbithack_handler(request_rec *r)
  +static int include_fixup(request_rec *r)
   {
   #if defined(OS2) || defined(WIN32) || defined(NETWARE)
       /* OS/2 dosen't currently support the xbithack. This is being worked on. */
  @@ -3201,17 +3201,28 @@
       conf = (include_dir_config *) ap_get_module_config(r->per_dir_config,
                                                   &include_module);
    
  -    if (*conf->xbithack == xbithack_off) {
  -        return DECLINED;
  +    if (r->handler && (strcmp(r->handler, "server-parsed") == 0)) 
  +    {
  +        if (!r->content_type || !*r->content_type) {
  +            r->content_type = "text/html";
  +        }
  +        r->handler = "default-handler";
       }
  +    else 
  +    {
  +        if (strcmp(r->handler, "text/html")) {
  +            return DECLINED;
  +        }
  +    
  +        if (*conf->xbithack == xbithack_off) {
  +            return DECLINED;
  +        }
   
  -    if (strcmp(r->handler, "text/html")) {
  -        return DECLINED;
  -    }
  -    if (!(r->finfo.protection & APR_UEXECUTE)) {
  -        return DECLINED;
  +        if (!(r->finfo.protection & APR_UEXECUTE)) {
  +            return DECLINED;
  +        }
       }
  - 
  +
       /* We always return declined, because the default handler will actually
        * serve the file.  All we have to do is add the filter.
        */
  @@ -3220,23 +3231,13 @@
   #endif
   }
   
  -static void insert_filter(request_rec *r)
  -{
  -    if (r->handler && (strcmp(r->handler, "server-parsed") == 0)) {
  -        ap_add_output_filter("INCLUDES", NULL, r, r->connection);
  -        r->content_type = "text/html";
  -        r->handler = "default-handler";
  -    }
  -}
  -
   static void register_hooks(apr_pool_t *p)
   {
       APR_REGISTER_OPTIONAL_FN(ap_ssi_get_tag_and_value);
       APR_REGISTER_OPTIONAL_FN(ap_ssi_parse_string);
       APR_REGISTER_OPTIONAL_FN(ap_register_include_handler);
       ap_hook_post_config(include_post_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
  -    ap_hook_handler(xbithack_handler, NULL, NULL, APR_HOOK_MIDDLE);
  -    ap_hook_insert_filter(insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
  +    ap_hook_fixups(include_fixup, NULL, NULL, APR_HOOK_LAST);
       ap_register_output_filter("INCLUDES", includes_filter, AP_FTYPE_CONTENT);
   }
   
  
  
  

Mime
View raw message