]> granicus.if.org Git - apache/commitdiff
Improvements suggested by Brian Pane, first assure all OS's get to deal
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 28 Dec 2001 17:44:28 +0000 (17:44 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 28 Dec 2001 17:44:28 +0000 (17:44 +0000)
  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

index ab2e057687a68965bee200740ce25fc7d13d6435..b135f09e956028f3198f1fdd0f978e573e573fe5 100644 (file)
@@ -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)