]> granicus.if.org Git - apache/blobdiff - server/util_debug.c
fr doc rebuild.
[apache] / server / util_debug.c
index cf8aa0e9c930faa9282a47f038ec9f633a58b9ae..3634402b64550b63633b206894a7531d632ac3ff 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "httpd.h"
 #include "http_config.h"
+#include "http_core.h"
 
 /* Possibly get rid of the macros we defined in httpd.h */
 #if defined(strchr)
@@ -106,6 +107,28 @@ AP_DECLARE(void *) ap_get_module_config(const ap_conf_vector_t *cv,
     return ((void **)cv)[m->module_index];
 }
 
+AP_DECLARE(int) ap_get_module_flags(const module *m)
+{
+    if (m->version < AP_MODULE_FLAGS_MMN_MAJOR
+            || (m->version == AP_MODULE_FLAGS_MMN_MAJOR
+                && (m->minor_version < AP_MODULE_FLAGS_MMN_MINOR))) {
+        return 0;
+    }
+
+    return m->flags;
+}
+
+#if defined(ap_get_core_module_config)
+#undef ap_get_core_module_config
+AP_DECLARE(void *) ap_get_core_module_config(const ap_conf_vector_t *cv);
+#endif
+
+AP_DECLARE(void *) ap_get_core_module_config(const ap_conf_vector_t *cv)
+{
+    return ((void **)cv)[AP_CORE_MODULE_INDEX];
+}
+
+
 #if defined(ap_get_server_module_loglevel)
 #undef ap_get_server_module_loglevel
 AP_DECLARE(int) ap_get_server_module_loglevel(const server_rec *s, int module_index);
@@ -139,6 +162,28 @@ AP_DECLARE(int) ap_get_conn_module_loglevel(const conn_rec *c, int module_index)
     return l->module_levels[module_index];
 }
 
+#if defined(ap_get_conn_server_module_loglevel)
+#undef ap_get_conn_server_module_loglevel
+AP_DECLARE(int) ap_get_conn_server_module_loglevel(const conn_rec *c,
+                                                   const server_rec *s,
+                                                   int module_index);
+#endif
+
+AP_DECLARE(int) ap_get_conn_server_module_loglevel(const conn_rec *c,
+                                                   const server_rec *s,
+                                                   int module_index)
+{
+    const struct ap_logconf *l = (c->log && c->log != &c->base_server->log) ?
+                                 c->log : &s->log;
+    if (module_index < 0 || l->module_levels == NULL ||
+        l->module_levels[module_index] < 0)
+    {
+        return l->level;
+    }
+
+    return l->module_levels[module_index];
+}
+
 #if defined(ap_get_request_module_loglevel)
 #undef ap_get_request_module_loglevel
 AP_DECLARE(int) ap_get_request_module_loglevel(const request_rec *c, int module_index);
@@ -178,3 +223,31 @@ AP_DECLARE(void) ap_set_module_config(ap_conf_vector_t *cv, const module *m,
 {
     ((void **)cv)[m->module_index] = val;
 }
+
+
+#if defined(ap_set_core_module_config)
+#undef ap_set_core_module_config
+AP_DECLARE(void) ap_set_core_module_config(ap_conf_vector_t *cv, void *val);
+#endif
+
+AP_DECLARE(void) ap_set_core_module_config(ap_conf_vector_t *cv, void *val)
+{
+    ((void **)cv)[AP_CORE_MODULE_INDEX] = val;
+}
+
+#if defined(apr_palloc)
+#undef apr_palloc
+#endif
+AP_DECLARE(void *) ap_palloc_debug(apr_pool_t *p, apr_size_t size)
+{
+    /* poison uninitialized memory */
+    return memset(apr_palloc(p, size), 0xEE, size);
+}
+
+#if defined(apr_pcalloc)
+#undef apr_pcalloc
+#endif
+AP_DECLARE(void *) ap_pcalloc_debug(apr_pool_t *p, apr_size_t size)
+{
+    return memset(apr_palloc(p, size), 0, size);
+}