mod_log_debug.c revision c07f5b18040b0d39b077666ad6fbbd28fe0eb5f1
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "apr_strings.h"
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"
#include "ap_expr.h"
typedef struct {
const char *hook;
} msg_entry;
typedef struct {
const char *allhooks = "all";
const char * const hooks[] = {
"log_transaction", /* 0 */
"quick_handler", /* 1 */
"handler", /* 2 */
"translate_name", /* 3 */
"map_to_storage", /* 4 */
"fixups", /* 5 */
"type_checker", /* 6 */
"check_access", /* 7 */
"check_access_ex", /* 8 */
"check_authn", /* 9 */
"check_authz", /* 10 */
"insert_filter", /* 11 */
};
{
int i;
return;
continue;
if (err) {
"Can't evaluate condition: %s", err);
continue;
}
if (!ret)
continue;
}
if (err)
"Can't evaluate message expression: %s", err);
if (APLOGrdebug(r))
else
}
}
static int log_debug_log_transaction(request_rec *r)
{
do_debug_log(r, hooks[0]);
return DECLINED;
}
{
return DECLINED;
}
static int log_debug_handler(request_rec *r)
{
return DECLINED;
}
static int log_debug_translate_name(request_rec *r)
{
return DECLINED;
}
static int log_debug_map_to_storage(request_rec *r)
{
return DECLINED;
}
static int log_debug_fixups(request_rec *r)
{
return DECLINED;
}
static int log_debug_type_checker(request_rec *r)
{
return DECLINED;
}
static int log_debug_check_access(request_rec *r)
{
return DECLINED;
}
static int log_debug_check_access_ex(request_rec *r)
{
return DECLINED;
}
static int log_debug_check_authn(request_rec *r)
{
return DECLINED;
}
static int log_debug_check_authz(request_rec *r)
{
return DECLINED;
}
static void log_debug_insert_filter(request_rec *r)
{
}
{
return dconf;
}
{
else
/* apr_array_append actually creates a new array */
return merged;
}
{
int i, j;
const char *err;
const char *args[2];
if (err)
"Could not parse message expression '%s': %s",
for (i = 0; i < 2; i++) {
break;
j = 0;
while (hooks[j]) {
break;
}
j++;
}
else
}
}
if (err)
"Could not parse expression '%s': %s",
}
else {
}
}
return NULL;
}
static const command_rec log_debug_cmds[] =
{
"Log a debug message to the error log if this config block is used for "
" a request"),
{NULL}
};
static void register_hooks(apr_pool_t *p)
{
ap_hook_check_access_ex(log_debug_check_access_ex, NULL, NULL, APR_HOOK_FIRST, AP_AUTH_INTERNAL_PER_URI);
}
{
log_debug_create_dconf, /* create per-dir config */
log_debug_merge_dconf, /* merge per-dir config */
NULL, /* server config */
NULL, /* merge server config */
log_debug_cmds, /* command apr_table_t */
register_hooks /* register hooks */
};