]> granicus.if.org Git - apache/commitdiff
fix mpm_get_name hook
authorJeff Trawick <trawick@apache.org>
Wed, 25 Mar 2009 18:57:09 +0000 (18:57 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 25 Mar 2009 18:57:09 +0000 (18:57 +0000)
a string can't be used as the declined value since the hook macro must compare
retcodes from hooks with that declined value

(thanks, gcc/Joe)

accommodate in ap_show_mpm() since we don't want to return NULL to the caller of
this simple API

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

server/mpm_common.c

index 6e92db3c60dbc8cce7dbd134dcb857fcdf6420be..d326a018709cd2a42d84a28fc36baef3857802a8 100644 (file)
@@ -104,7 +104,7 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_register_timed_callback,
                             (t, cbfn, baton), APR_ENOTIMPL)
 AP_IMPLEMENT_HOOK_RUN_FIRST(const char *, mpm_get_name,
                             (void),
-                            (), "")
+                            (), NULL)
 
 /* number of calls to wait_or_timeout between writable probes */
 #ifndef INTERVAL_OF_WRITABLE_PROBES
@@ -442,5 +442,11 @@ AP_DECLARE(apr_status_t) ap_mpm_register_timed_callback(apr_time_t t, ap_mpm_cal
 
 AP_DECLARE(const char *)ap_show_mpm(void)
 {
-    return ap_run_mpm_get_name();
+    const char *name = ap_run_mpm_get_name();
+
+    if (!name) {
+        name = "";
+    }
+
+    return name;
 }