]> granicus.if.org Git - apache/blobdiff - server/util_debug.c
use APR_STATUS_IS_TIMEUP() instead of direct comparison with APR_TIMEUP.
[apache] / server / util_debug.c
index 0230038b0e6384600a08739fd677ec11d87c07c1..3e753f786df2f4f793ecba604342beb3666b8b23 100644 (file)
@@ -106,20 +106,78 @@ AP_DECLARE(void *) ap_get_module_config(const ap_conf_vector_t *cv,
     return ((void **)cv)[m->module_index];
 }
 
-#if defined(ap_get_module_loglevel)
-#undef ap_get_module_loglevel
-AP_DECLARE(int) ap_get_module_loglevel(const server_rec *s, int 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);
 #endif
 
-AP_DECLARE(int) ap_get_module_loglevel(const server_rec *s, int module_index)
+AP_DECLARE(int) ap_get_server_module_loglevel(const server_rec *s, int module_index)
 {
-    if (module_index < 0 || s->module_loglevels == NULL ||
-        s->module_loglevels[module_index] < 0)
+    if (module_index < 0 || s->log.module_levels == NULL ||
+        s->log.module_levels[module_index] < 0)
     {
-        return s->loglevel;
+        return s->log.level;
     }
 
-    return s->module_loglevels[module_index];
+    return s->log.module_levels[module_index];
+}
+
+#if defined(ap_get_conn_module_loglevel)
+#undef ap_get_conn_module_loglevel
+AP_DECLARE(int) ap_get_conn_module_loglevel(const conn_rec *c, int module_index);
+#endif
+
+AP_DECLARE(int) ap_get_conn_module_loglevel(const conn_rec *c, int module_index)
+{
+    const struct ap_logconf *l = (c)->log ? (c)->log : &(c)->base_server->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_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);
+#endif
+
+AP_DECLARE(int) ap_get_request_module_loglevel(const request_rec *r, int module_index)
+{
+    const struct ap_logconf *l = r->log             ? r->log             :
+                                 r->connection->log ? r->connection->log :
+                                 &r->server->log;
+    if (module_index < 0 || l->module_levels == NULL ||
+        l->module_levels[module_index] < 0)
+    {
+        return l->level;
+    }
+
+    return l->module_levels[module_index];
 }
 
 /**