From cf8161cf72444d68eb9003e96975cbb6ad6ba7e5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Dec 2001 17:44:28 +0000 Subject: [PATCH] Improvements suggested by Brian Pane, first assure all OS's get to deal with handler 'server-parsed', do the xbithack bit tests before testing it's string values (protected against a null point). And make it [perhaps] more legible. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92642 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_include.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index ab2e057687..b135f09e95 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -3192,10 +3192,6 @@ static const command_rec includes_cmds[] = 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. */ - return DECLINED; -#else include_dir_config *conf; conf = (include_dir_config *) ap_get_module_config(r->per_dir_config, @@ -3209,11 +3205,13 @@ static int include_fixup(request_rec *r) r->handler = "default-handler"; } else +#if defined(OS2) || defined(WIN32) || defined(NETWARE) + /* These OS's don't support xbithack. This is being worked on. */ + { + return DECLINED; + } +#else { - if (strcmp(r->handler, "text/html")) { - return DECLINED; - } - if (*conf->xbithack == xbithack_off) { return DECLINED; } @@ -3221,14 +3219,18 @@ static int include_fixup(request_rec *r) if (!(r->finfo.protection & APR_UEXECUTE)) { return DECLINED; } + + if (!r->handler || strcmp(r->handler, "text/html")) { + return DECLINED; + } } +#endif - /* We always return declined, because the default handler will actually - * serve the file. All we have to do is add the filter. + /* We always return declined, because the default handler actually + * serves the file. All we have to do is add the filter. */ ap_add_output_filter("INCLUDES", NULL, r, r->connection); return DECLINED; -#endif } static void register_hooks(apr_pool_t *p) -- 2.50.1