diff options
author | Christophe Jaillet <jailletc36@apache.org> | 2012-11-21 20:40:01 +0000 |
---|---|---|
committer | Christophe Jaillet <jailletc36@apache.org> | 2012-11-21 20:40:01 +0000 |
commit | 87eaa05972cb1915e2ee733aa4b9cd217f7ebde0 (patch) | |
tree | 3ad5622dc5d961f3ee87ea4e1f9f97c71a382459 /modules/debugging | |
parent | baf137d08f22afb3a922711fe3b185b9ae8298b4 (diff) | |
download | httpd-87eaa05972cb1915e2ee733aa4b9cd217f7ebde0.tar.gz |
mod_dumpio: Correctly log large messages + style issues
PR 54179
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1412278 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/debugging')
-rw-r--r-- | modules/debugging/mod_dumpio.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/modules/debugging/mod_dumpio.c b/modules/debugging/mod_dumpio.c index e02127b80d..c2ef657b85 100644 --- a/modules/debugging/mod_dumpio.c +++ b/modules/debugging/mod_dumpio.c @@ -45,7 +45,7 @@ typedef struct dumpio_conf_t { * line length of all \xNN sequences; log_error cannot record more * than MAX_STRING_LEN characters. */ -#define dumpio_MAX_STRING_LEN MAX_STRING_LEN / 4 - 80 +#define dumpio_MAX_STRING_LEN (MAX_STRING_LEN / 4 - 80) /* * Workhorse function: simply log to the current error_log @@ -102,8 +102,10 @@ static void dumpit(ap_filter_t *f, apr_bucket *b, dumpio_conf_t *ptr) (APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data", b->type->name, (int)logbytes, buf); #endif + buf += logbytes; } - } else { + } + else { ap_log_cerror(APLOG_MARK, APLOG_TRACE7, rv, c, "mod_dumpio: %s (%s-%s): %s", f->frec->name, (APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data", @@ -135,7 +137,7 @@ static int dumpio_input_filter (ap_filter_t *f, apr_bucket_brigade *bb, f->frec->name, whichmode(mode), ((block) == APR_BLOCK_READ) ? "blocking" : "nonblocking", - readbytes) ; + readbytes); ret = ap_get_brigade(f->next, bb, mode, block, readbytes); @@ -143,7 +145,8 @@ static int dumpio_input_filter (ap_filter_t *f, apr_bucket_brigade *bb, for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) { dumpit(f, b, ptr); } - } else { + } + else { ap_log_cerror(APLOG_MARK, APLOG_TRACE7, 0, c, "mod_dumpio: %s - %d", f->frec->name, ret) ; return ret; @@ -205,15 +208,15 @@ static void dumpio_register_hooks(apr_pool_t *p) static void *dumpio_create_sconfig(apr_pool_t *p, server_rec *s) { dumpio_conf_t *ptr = apr_pcalloc(p, sizeof *ptr); - ptr->enable_input = ptr->enable_output = 0; + ptr->enable_input = 0; + ptr->enable_output = 0; return ptr; } static const char *dumpio_enable_input(cmd_parms *cmd, void *dummy, int arg) { - dumpio_conf_t *ptr = - (dumpio_conf_t *) ap_get_module_config(cmd->server->module_config, - &dumpio_module); + dumpio_conf_t *ptr = ap_get_module_config(cmd->server->module_config, + &dumpio_module); ptr->enable_input = arg; return NULL; @@ -221,9 +224,8 @@ static const char *dumpio_enable_input(cmd_parms *cmd, void *dummy, int arg) static const char *dumpio_enable_output(cmd_parms *cmd, void *dummy, int arg) { - dumpio_conf_t *ptr = - (dumpio_conf_t *) ap_get_module_config(cmd->server->module_config, - &dumpio_module); + dumpio_conf_t *ptr = ap_get_module_config(cmd->server->module_config, + &dumpio_module); ptr->enable_output = arg; return NULL; @@ -239,10 +241,10 @@ static const command_rec dumpio_cmds[] = { AP_DECLARE_MODULE(dumpio) = { STANDARD20_MODULE_STUFF, - NULL, - NULL, - dumpio_create_sconfig, - NULL, - dumpio_cmds, - dumpio_register_hooks + NULL, /* create per-dir config structures */ + NULL, /* merge per-dir config structures */ + dumpio_create_sconfig, /* create per-server config structures */ + NULL, /* merge per-server config structures */ + dumpio_cmds, /* table of config file commands */ + dumpio_register_hooks /* register hooks */ }; |