]> granicus.if.org Git - apache/commitdiff
adjust remaining modules to use the new handler hook method (Alan Edwards)
authorDoug MacEachern <dougm@apache.org>
Mon, 8 Jan 2001 23:55:12 +0000 (23:55 +0000)
committerDoug MacEachern <dougm@apache.org>
Mon, 8 Jan 2001 23:55:12 +0000 (23:55 +0000)
bring back the old handler prototype by reusing r->handler (dougm)
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87617 13f79535-47bb-0310-9956-ffa450edef68

30 files changed:
include/http_config.h
libhttpd.def
modules/aaa/mod_auth_anon.c
modules/aaa/mod_auth_db.c
modules/aaa/mod_auth_dbm.c
modules/aaa/mod_auth_digest.c
modules/arch/win32/mod_isapi.c
modules/cache/mod_file_cache.c
modules/dav/fs/mod_dav_fs.c
modules/dav/main/mod_dav.c
modules/generators/mod_asis.c
modules/generators/mod_autoindex.c
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c
modules/generators/mod_status.c
modules/http/http_core.c
modules/mappers/mod_actions.c
modules/mappers/mod_dir.c
modules/mappers/mod_imap.c
modules/mappers/mod_negotiation.c
modules/mappers/mod_rewrite.c
modules/mappers/mod_so.c
modules/mappers/mod_speling.c
modules/metadata/mod_cern_meta.c
modules/metadata/mod_expires.c
modules/metadata/mod_headers.c
modules/metadata/mod_usertrack.c
os/win32/mod_isapi.c
server/config.c
server/mpm/winnt/mpm_winnt.c

index a515df31f0705c5f7c0876c8fe5f67aff08f8956..f691b3ddecc58784276f43ec17d315d4476db7cb 100644 (file)
@@ -993,12 +993,11 @@ AP_DECLARE_HOOK(void,child_init,(apr_pool_t *pchild, server_rec *s))
 
 /**
  * Run the handler functions for each module
- * @param handler The handler string (a MIME type or a handler)
  * @param r The request_rec
- * @deffunc void ap_run_handler(const char *handler,request_rec *r)
+ * @deffunc void ap_run_handler(request_rec *r)
  * @tip non-wildcard handlers should HOOK_MIDDLE, wildcard HOOK_LAST
  */
-AP_DECLARE_HOOK(int,handler,(const char *handler,request_rec *r))
+AP_DECLARE_HOOK(int,handler,(request_rec *))
 
 #ifdef __cplusplus
 }
index 0f0f9c991e51aec096e88e009c25da0bd4bd5b85..b8e66fd7e9ebac64f423b3cdd5d15565a258938f 100644 (file)
@@ -376,6 +376,7 @@ EXPORTS
         ap_hook_post_config
         ap_hook_open_logs
         ap_hook_child_init
+        ap_hook_handler
 
         ap_get_status_table
         ap_run_default_port
index 9a90f65d4689b8aca850a2a61df3134df00fb5ca..703aa00a0549eb0c603a485b1f7eebfc067ef729 100644 (file)
@@ -308,6 +308,5 @@ module AP_MODULE_DECLARE_DATA anon_auth_module =
     NULL,                      /* server config */
     NULL,                      /* merge server config */
     anon_auth_cmds,            /* command apr_table_t */
-    NULL,                      /* handlers */
     register_hooks             /* register hooks */
 };
index 193332f8f4646d194cc9e0039cd2c8453780dc16..552e2b798941c60db6c63b667e165ac39587049c 100644 (file)
@@ -409,7 +409,6 @@ module db_auth_module =
     NULL,                      /* server config */
     NULL,                      /* merge server config */
     db_auth_cmds,              /* command apr_table_t */
-    NULL,                      /* handlers */
     register_hooks             /* register hooks */
 };
 
index f2d5107757142be4ad54e0266e252a4628a06ddd..7399aa036ff396ddb4e55850f50b20c28c877582 100644 (file)
@@ -349,6 +349,5 @@ module AP_MODULE_DECLARE_DATA dbm_auth_module =
     NULL,                      /* server config */
     NULL,                      /* merge server config */
     dbm_auth_cmds,             /* command apr_table_t */
-    NULL,                      /* handlers */
     register_hooks              /* register hooks */
 };
index 76501b8d212571abac87892ddabd5b282f9deb70..d230c4a4857fdef736e1076bf09da5d60bcf0721 100644 (file)
@@ -2070,7 +2070,6 @@ module AP_MODULE_DECLARE_DATA digest_auth_module =
     NULL,                      /* server config */
     NULL,                      /* merge server config */
     digest_cmds,               /* command table */
-    NULL,                      /* handlers */
     register_hooks             /* register hooks */
 };
 
index 64a93ba02c8e03de6efedab3763d3e73cc30e3da..f7dfe6dfff8d67df33313c89ae759687cc102502 100644 (file)
@@ -347,15 +347,20 @@ static int isapi_unload(isapi_loaded* isa, int force)
 
 apr_status_t isapi_handler (request_rec *r)
 {
-    isapi_server_conf *sconf = ap_get_module_config(r->server->module_config, 
-                                                    &isapi_module);
-    apr_table_t *e = r->subprocess_env;
+    isapi_server_conf * sconf;
+    apr_table_t *e;
     apr_status_t rv;
     isapi_loaded *isa;
     isapi_cid *cid;
     DWORD read;
     int res;
     
+    if(strcmp(r->handler, "isapi-isa"))
+        return DECLINED;    
+
+    sconf = ap_get_module_config(r->server->module_config, &isapi_module);
+    e = r->subprocess_env;
+
     /* Use similar restrictions as CGIs
      *
      * If this fails, it's pointless to load the isapi dll.
@@ -1262,6 +1267,7 @@ static const char *isapi_cmd_cachefile(cmd_parms *cmd, void *dummy,
 static void isapi_hooks(void)
 {
     ap_hook_post_config(isapi_post_config, NULL, NULL, AP_HOOK_MIDDLE);
+    ap_hook_handler(isapi_handler, NULL, NULL, AP_HOOK_MIDDLE);
 }
 
 static const command_rec isapi_cmds[] = {
@@ -1278,11 +1284,6 @@ AP_INIT_ITERATE("ISAPICacheFile", isapi_cmd_cachefile, NULL, RSRC_CONF,
 { NULL }
 };
 
-handler_rec isapi_handlers[] = {
-    { "isapi-isa", isapi_handler },
-    { NULL}
-};
-
 module isapi_module = {
    STANDARD20_MODULE_STUFF,
    NULL,                        /* create per-dir config */
@@ -1290,6 +1291,5 @@ module isapi_module = {
    create_isapi_server_config,  /* server config */
    NULL,                        /* merge server config */
    isapi_cmds,                  /* command apr_table_t */
-   isapi_handlers,              /* handlers */
    isapi_hooks                  /* register hooks */
 };
index e256055fab22a95060baef0b4db71b13a231423b..2271287748b05c2cfa18c346f419cd121aca01ce 100644 (file)
@@ -422,6 +422,10 @@ static int file_cache_handler(request_rec *r)
     int errstatus;
     int rc = OK;
 
+    if (strcmp(r->handler, "*.*")) {
+        return DECLINED;
+    }
+
     /* we don't handle anything but GET */
     if (r->method_number != M_GET) return DECLINED;
 
@@ -473,6 +477,7 @@ AP_INIT_ITERATE("mmapfile", mmapfile, NULL, RSRC_CONF,
 
 static void register_hooks(void)
 {
+    ap_hook_handler(file_cache_handler, NULL, NULL, AP_HOOK_MIDDLE);
     ap_hook_post_config(file_cache_post_config, NULL, NULL, AP_HOOK_MIDDLE);
     ap_hook_translate_name(file_cache_xlat, NULL, NULL, AP_HOOK_MIDDLE);
     /* This trick doesn't work apparently because the translate hooks
@@ -483,12 +488,6 @@ static void register_hooks(void)
 
 }
 
-static const handler_rec file_cache_handlers[] =
-{
-    { "*/*", file_cache_handler },
-    { NULL }
-};
-
 module AP_MODULE_DECLARE_DATA file_cache_module =
 {
     STANDARD20_MODULE_STUFF,
@@ -497,6 +496,5 @@ module AP_MODULE_DECLARE_DATA file_cache_module =
     create_server_config,     /* create per-server config structure */
     NULL,                     /* merge per-server config structures */
     file_cache_cmds,          /* command handlers */
-    file_cache_handlers,      /* handlers */
     register_hooks            /* register hooks */
 };
index 9d32c081f54d98014b3bbff021b422a4c166b1a2..20d2c32110449dae5cb043e0c8733f4361c7bfc3 100644 (file)
@@ -138,6 +138,5 @@ module AP_MODULE_DECLARE_DATA dav_fs_module =
     dav_fs_create_server_config,       /* server config */
     dav_fs_merge_server_config,        /* merge server config */
     dav_fs_cmds,               /* command table */
-    NULL,                       /* handlers */
     register_hooks,             /* register hooks */
 };
index 360b66f4f914b8461b73e91f6f8f277f5648bb45..d925d587e919966b7aee9ff518d98461a81cb74f 100644 (file)
@@ -3788,6 +3788,10 @@ static int dav_handler(request_rec *r)
 {
     dav_dir_conf *conf;
 
+    if (strcmp(r->handler, "dav-handler")) {
+       return DECLINED;
+    }
+
     /* quickly ignore any HTTP/0.9 requests */
     if (r->assbackwards) {
        return DECLINED;
@@ -4004,6 +4008,7 @@ static int dav_type_checker(request_rec *r)
 
 static void register_hooks(void)
 {
+    ap_hook_handler(dav_handler, NULL, NULL, AP_HOOK_MIDDLE);
     ap_hook_post_config(dav_init_handler, NULL, NULL, AP_HOOK_MIDDLE);
     ap_hook_type_checker(dav_type_checker, NULL, NULL, AP_HOOK_FIRST);
 
@@ -4044,12 +4049,6 @@ static const command_rec dav_cmds[] =
     { NULL }
 };
 
-static const handler_rec dav_handlers[] =
-{
-    {"dav-handler", dav_handler},
-    { NULL }
-};
-
 module DAV_DECLARE_DATA dav_module =
 {
     STANDARD20_MODULE_STUFF,
@@ -4058,7 +4057,6 @@ module DAV_DECLARE_DATA dav_module =
     dav_create_server_config,  /* server config */
     dav_merge_server_config,   /* merge server config */
     dav_cmds,                  /* command table */
-    dav_handlers,              /* handlers */
     register_hooks,             /* register hooks */
 };
 
index 5702a907bf844628c93df1e378401e74673cc75f..6b7de1d27f128f895eb18d33e35f92241c533f42 100644 (file)
 
 #define ASIS_MAGIC_TYPE "httpd/send-as-is"
 
-static int asis_handler(const char *handler,request_rec *r)
+static int asis_handler(request_rec *r)
 {
     apr_file_t *f = NULL;
     apr_status_t status;
     const char *location;
     apr_size_t nbytes;
 
-    if(strcmp(handler,ASIS_MAGIC_TYPE) && strcmp(handler,"send-as-is"))
+    if(strcmp(r->handler,ASIS_MAGIC_TYPE) && strcmp(r->handler,"send-as-is"))
        return DECLINED;
 
     r->allowed |= (1 << M_GET);
index 79891d3d8fd0b1a00f7db11372ef238d9ac2496f..d4734ff93c1b2b275ef421624c089f433efbc5ad 100644 (file)
@@ -1660,12 +1660,12 @@ static int index_directory(request_rec *r,
 
 /* The formal handler... */
 
-static int handle_autoindex(const char *handler,request_rec *r)
+static int handle_autoindex(request_rec *r)
 {
     autoindex_config_rec *d;
     int allow_opts;
 
-    if(strcmp(handler,DIR_MAGIC_TYPE))
+    if(strcmp(r->handler,DIR_MAGIC_TYPE))
        return DECLINED;
 
     allow_opts = ap_allow_options(r);
index b1193d6a398d2fc3b3266632761755d2406a83d3..8ccc223627bef0a232c23a9282eb76e0a6d1fed0 100644 (file)
@@ -498,7 +498,7 @@ static apr_status_t build_command_line(const char **cmd, request_rec *r,
     return APR_SUCCESS;
 }
 
-static int cgi_handler(const char *handler, request_rec *r)
+static int cgi_handler(request_rec *r)
 {
     int retval, nph, dbpos = 0;
     const char *argv0;
@@ -514,7 +514,7 @@ static int cgi_handler(const char *handler, request_rec *r)
     cgi_server_conf *conf;
     apr_status_t rv;
 
-    if(strcmp(handler,CGI_MAGIC_TYPE) && strcmp(handler,"cgi-script"))
+    if(strcmp(r->handler,CGI_MAGIC_TYPE) && strcmp(r->handler,"cgi-script"))
        return DECLINED;
 
     p = r->main ? r->main->pool : r->pool;
index 24fcee7a905ff1c202476cf4049ccd410c2982cd..2155a839e64b7b5da9b77c2ff877187906711d5d 100644 (file)
@@ -730,7 +730,7 @@ static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
  * 
  * Actual cgid handling... 
  */ 
-static int cgid_handler(const char *handler, request_rec *r) 
+static int cgid_handler(request_rec *r) 
 { 
     int retval, nph, dbpos = 0; 
     char *argv0, *dbuf = NULL; 
@@ -746,7 +746,7 @@ static int cgid_handler(const char *handler, request_rec *r)
     apr_file_t *tempsock = NULL;
     apr_size_t nbytes;
 
-    if(strcmp(handler,CGI_MAGIC_TYPE) && strcmp(handler,"cgi-script"))
+    if(strcmp(r->handler,CGI_MAGIC_TYPE) && strcmp(r->handler,"cgi-script"))
        return DECLINED;
 
     if (r->method_number == M_OPTIONS) { 
index fff13b21e27e2a933245bc3f082b8a6d11961f4a..4e204b6e25cc03e51dfa9b79d4b482a1d1a7474a 100644 (file)
@@ -84,6 +84,10 @@ static int status_handler(request_rec *r)
     apr_array_header_t *server_status;
     ap_status_table_row_t *status_rows;
 
+    if (strcmp(r->handler, STATUS_MAGIC_TYPE) && strcmp(r->handler, "server-status")) {
+        return DECLINED;
+    }
+
     r->allowed = (1 << M_GET);
     if (r->method_number != M_GET)
        return DECLINED;
@@ -120,12 +124,10 @@ static int status_handler(request_rec *r)
     return 0;
 }
 
-static const handler_rec status_handlers[] =
+static void register_hooks(void)
 {
-    {STATUS_MAGIC_TYPE, status_handler},
-    {"server-status", status_handler},
-    {NULL}
-};
+    ap_hook_handler(status_handler, NULL, NULL, AP_HOOK_MIDDLE);
+}
 
 module AP_MODULE_DECLARE_DATA status_module =
 {
@@ -135,6 +137,5 @@ module AP_MODULE_DECLARE_DATA status_module =
     NULL,                      /* server config */
     NULL,                      /* merge server config */
     NULL,                      /* command table */
-    status_handlers,           /* handlers */
-    NULL                        /* register hooks */
+    register_hooks     /* register hooks */
 };
index cca74c68ed779e17187c15cf24723361e6b85e0d..312bca727f7926190ceeb2721e682589e4cac607 100644 (file)
@@ -2971,7 +2971,7 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r)
 
 static int do_nothing(request_rec *r) { return OK; }
 
-static int default_handler(const char *handler, request_rec *r)
+static int default_handler(request_rec *r)
 {
     ap_bucket_brigade *bb;
     ap_bucket *e;
@@ -2994,8 +2994,8 @@ static int default_handler(const char *handler, request_rec *r)
      * have a / in the middle, which probably captures the original
      * intent, but may cause problems at first - Ben 7th Jan 01
      */
-    if(strcmp(handler,"request-handler")
-       && ap_strcmp_match(handler,"*/*"))
+    if(strcmp(r->handler,"default-handler")
+       && ap_strcmp_match(r->handler,"*/*"))
        return DECLINED;
 
     d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
index 31639a223528dd225696c0936b3f3984b9836b28..5c400bc477cb80d1bdb0ab1f4f60b223896bd043 100644 (file)
@@ -158,7 +158,7 @@ static const command_rec action_cmds[] =
     {NULL}
 };
 
-static int action_handler(const char *handler,request_rec *r)
+static int action_handler(request_rec *r)
 {
     action_dir_config *conf = (action_dir_config *)
         ap_get_module_config(r->per_dir_config, &action_module);
index 9391a919b7aaf3ee002d13eddff7193e4879fcb1..9d305da8621c256c52c6d0e2c164fd20c7469bd1 100644 (file)
@@ -116,7 +116,7 @@ static void *merge_dir_configs(apr_pool_t *p, void *basev, void *addv)
     return new;
 }
 
-static int handle_dir(const char *handler,request_rec *r)
+static int handle_dir(request_rec *r)
 {
     dir_config_rec *d;
     char *dummy_ptr[1];
@@ -124,7 +124,7 @@ static int handle_dir(const char *handler,request_rec *r)
     int num_names;
     int error_notfound = 0;
 
-    if(strcmp(handler,DIR_MAGIC_TYPE))
+    if(strcmp(r->handler,DIR_MAGIC_TYPE))
        return DECLINED;
 
     d = (dir_config_rec *) ap_get_module_config(r->per_dir_config,
index 61544f82ee53d01f1bccc4e1ba921c896cb8c46d..f3781dd5201acc50bb4e26677417197a9011701e 100644 (file)
@@ -612,7 +612,7 @@ static void menu_footer(request_rec *r)
     ap_rputs("\n\n</body>\n</html>\n", r);         /* finish the menu */
 }
 
-static int imap_handler(const char *handler,request_rec *r)
+static int imap_handler(request_rec *r)
 {
     char input[MAX_STRING_LEN];
     char *directive;
@@ -640,8 +640,8 @@ static int imap_handler(const char *handler,request_rec *r)
 
     configfile_t *imap; 
 
-    if (r->method_number != M_GET || (strcmp(handler,IMAP_MAGIC_TYPE)
-                                     && strcmp(handler, "imap-file")))
+    if (r->method_number != M_GET || (strcmp(r->handler,IMAP_MAGIC_TYPE)
+                                     && strcmp(r->handler, "imap-file")))
        return DECLINED;
 
     icr = ap_get_module_config(r->per_dir_config, &imap_module);
index 2120d8d26a61d75f1d4b96c0edc0b88d1dd7241d..a7add86bf6dce8783b2f4456cb8e799751ab12c6 100644 (file)
@@ -2566,14 +2566,14 @@ static int do_negotiation(request_rec *r, negotiation_state *neg,
     return OK;
 }
 
-static int handle_map_file(const char *handler,request_rec *r)
+static int handle_map_file(request_rec *r)
 {
     negotiation_state *neg;
     var_rec *best;
     int res;
     char *udir;
 
-    if(strcmp(handler,MAP_FILE_MAGIC_TYPE) && strcmp(handler,"type-map"))
+    if(strcmp(r->handler,MAP_FILE_MAGIC_TYPE) && strcmp(r->handler,"type-map"))
        return DECLINED;
 
     neg = parse_accept_headers(r);
index f25bcfd8beebf7c125e91ce09f1872e8490e71a8..d170cbe28cc23003a4d38edccbcbe488cdc4196f 100644 (file)
@@ -210,14 +210,9 @@ static const command_rec command_table[] = {
     { NULL }
 };
 
-    /* the apr_table_t of content handlers we provide */
-static const handler_rec handler_table[] = {
-    { "redirect-handler", handler_redirect },
-    { NULL }
-};
-
 static void register_hooks(void)
 {
+    ap_hook_handler(handler_redirect, NULL, NULL, AP_HOOK_MIDDLE);
     ap_hook_post_config(init_module,NULL,NULL,AP_HOOK_MIDDLE);
     ap_hook_child_init(init_child,NULL,NULL,AP_HOOK_MIDDLE);
 
@@ -234,7 +229,6 @@ module AP_MODULE_DECLARE_DATA rewrite_module = {
    config_server_create,        /* create per-server config structures */
    config_server_merge,         /* merge  per-server config structures */
    command_table,               /* apr_table_t of config file commands  */
-   handler_table,               /* [#8] MIME-typed-dispatched handlers */
    register_hooks               /* register hooks                      */
 };
 
@@ -1628,6 +1622,10 @@ static int hook_fixup(request_rec *r)
 
 static int handler_redirect(request_rec *r)
 {
+    if (strcmp(r->handler, "redirect-handler")) {
+        return DECLINED;
+    }
+
     /* just make sure that we are really meant! */
     if (strncmp(r->filename, "redirect:", 9) != 0) {
         return DECLINED;
index 2029582ee3c925440b459946c9a4b5fef3b050ba..ea012f9bac287e7d85c5ccda9feec574265ac430 100644 (file)
@@ -379,6 +379,5 @@ module AP_MODULE_DECLARE_DATA so_module = {
    so_sconf_create,            /* server config */
    NULL,                           /* merge server config */
    so_cmds,                        /* command apr_table_t */
-   NULL,                           /* handlers */
    NULL                                    /* register hooks */
 };
index 82e9066855f84406bf9146ab0f1b8821a73f19b0..ef4e80b08d3ce17c92f17c9c99a3803e7635c2f5 100644 (file)
@@ -564,6 +564,5 @@ module AP_MODULE_DECLARE_DATA speling_module =
     create_mconfig_for_server,  /* server config */
     NULL,                       /* merge server config */
     speling_cmds,               /* command apr_table_t */
-    NULL,                       /* handlers */
     register_hooks             /* register hooks */
 };
index 3a4d4e1c80a95705b86803191b0ea8defb25788a..0c2d3db5051745e0bb39e412c8ee609c87627282 100644 (file)
@@ -397,6 +397,5 @@ module AP_MODULE_DECLARE_DATA cern_meta_module =
     NULL,                      /* server config */
     NULL,                      /* merge server configs */
     cern_meta_cmds,            /* command apr_table_t */
-    NULL,                      /* handlers */
     register_hooks             /* register hooks */
 };
index 9f853e16a0a194fdf3737231d5c62b4b4e7986bd..d06268966a0cd9f66637adb4482601ba4cde14f8 100644 (file)
@@ -516,6 +516,5 @@ module AP_MODULE_DECLARE_DATA expires_module =
     NULL,                       /* server config */
     NULL,                       /* merge server configs */
     expires_cmds,               /* command apr_table_t */
-    NULL,                       /* handlers */
     register_hooks             /* register hooks */
 };
index 2c7896cfbbf83a56952fceb00567d068379c1077..4bf81a49a9024588de7144f8c6998fbf41568f89 100644 (file)
@@ -262,6 +262,5 @@ module AP_MODULE_DECLARE_DATA headers_module =
     create_headers_config,      /* server config */
     merge_headers_config,       /* merge server configs */
     headers_cmds,               /* command apr_table_t */
-    NULL,                       /* handlers */
     register_hooks             /* register hooks */
 };
index 811426bab857c2740b8f39867a58f84e9e765049..80dd3c1ba54473d8cadc17c557820839fceb8789 100644 (file)
@@ -319,6 +319,5 @@ module AP_MODULE_DECLARE_DATA usertrack_module = {
     make_cookie_log_state,      /* server config */
     NULL,                       /* merge server configs */
     cookie_log_cmds,            /* command apr_table_t */
-    NULL,                       /* handlers */
     register_hooks             /* register hooks */
 };
index 64a93ba02c8e03de6efedab3763d3e73cc30e3da..f7dfe6dfff8d67df33313c89ae759687cc102502 100644 (file)
@@ -347,15 +347,20 @@ static int isapi_unload(isapi_loaded* isa, int force)
 
 apr_status_t isapi_handler (request_rec *r)
 {
-    isapi_server_conf *sconf = ap_get_module_config(r->server->module_config, 
-                                                    &isapi_module);
-    apr_table_t *e = r->subprocess_env;
+    isapi_server_conf * sconf;
+    apr_table_t *e;
     apr_status_t rv;
     isapi_loaded *isa;
     isapi_cid *cid;
     DWORD read;
     int res;
     
+    if(strcmp(r->handler, "isapi-isa"))
+        return DECLINED;    
+
+    sconf = ap_get_module_config(r->server->module_config, &isapi_module);
+    e = r->subprocess_env;
+
     /* Use similar restrictions as CGIs
      *
      * If this fails, it's pointless to load the isapi dll.
@@ -1262,6 +1267,7 @@ static const char *isapi_cmd_cachefile(cmd_parms *cmd, void *dummy,
 static void isapi_hooks(void)
 {
     ap_hook_post_config(isapi_post_config, NULL, NULL, AP_HOOK_MIDDLE);
+    ap_hook_handler(isapi_handler, NULL, NULL, AP_HOOK_MIDDLE);
 }
 
 static const command_rec isapi_cmds[] = {
@@ -1278,11 +1284,6 @@ AP_INIT_ITERATE("ISAPICacheFile", isapi_cmd_cachefile, NULL, RSRC_CONF,
 { NULL }
 };
 
-handler_rec isapi_handlers[] = {
-    { "isapi-isa", isapi_handler },
-    { NULL}
-};
-
 module isapi_module = {
    STANDARD20_MODULE_STUFF,
    NULL,                        /* create per-dir config */
@@ -1290,6 +1291,5 @@ module isapi_module = {
    create_isapi_server_config,  /* server config */
    NULL,                        /* merge server config */
    isapi_cmds,                  /* command apr_table_t */
-   isapi_handlers,              /* handlers */
    isapi_hooks                  /* register hooks */
 };
index 573591c592f7d25dd76fb17666103e580813c6e9..ea0f432df1e5547c8630c02dbfb4d56dbb742f7b 100644 (file)
@@ -132,8 +132,8 @@ AP_IMPLEMENT_HOOK_VOID(open_logs,
 AP_IMPLEMENT_HOOK_VOID(child_init,
                        (apr_pool_t *pchild, server_rec *s),(pchild,s))
 
-AP_IMPLEMENT_HOOK_RUN_FIRST(int,handler,(const char *handler,request_rec *r),
-                           (handler,r),DECLINED)
+AP_IMPLEMENT_HOOK_RUN_FIRST(int,handler,(request_rec *r),
+                           (r),DECLINED)
 
 /****************************************************************
  *
@@ -283,11 +283,9 @@ int ap_invoke_handler(request_rec *r)
     char *p2;
     int result;
     char hbuf[MAX_STRING_LEN];
+    const char *old_handler = r->handler;
 
-    if (r->handler) {
-        handler = r->handler;
-    }
-    else {
+    if (!r->handler) {
         handler = r->content_type ? r->content_type : ap_default_type(r);
         if ((p=ap_strchr_c(handler, ';')) != NULL) {
            apr_cpystrn(hbuf, handler, sizeof hbuf);
@@ -298,9 +296,12 @@ int ap_invoke_handler(request_rec *r)
                --p2;           /* strip trailing spaces */
            *p2='\0';
        }
+        r->handler = handler;
     }
 
-    result = ap_run_handler(handler ,r);
+    result = ap_run_handler(r);
+
+    r->handler = old_handler;
 
     if (result == DECLINED && r->handler && r->filename) {
         ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
index 6ad24f34413624b538a0516eab6d2b10f8082338..2a2303c1156537913f93c8d0c2e3efe8c08dd7e6 100644 (file)
@@ -2348,6 +2348,5 @@ AP_MODULE_DECLARE_DATA module mpm_winnt_module = {
     NULL,                      /* create per-server config structure */
     NULL,                      /* merge per-server config structures */
     winnt_cmds,                        /* command apr_table_t */
-    NULL,                      /* handlers */
     winnt_hooks                /* register_hooks */
 };