From ee3b44ebf4be5bb7d207aba54e8073a316fba479 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Tue, 4 Dec 2012 02:28:16 +0000 Subject: [PATCH] Merge r1412278 from https://svn.apache.org/repos/asf/httpd/httpd/trunk/: mod_dumpio: Correctly log large messages + style issues PR 54179 Submitted by: Marek Wianecki Reviewed by: jailletc36, sf, druggeri git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1416749 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 6 ------ modules/debugging/mod_dumpio.c | 36 ++++++++++++++++++---------------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/CHANGES b/CHANGES index be14bcd743..a6aa0d7674 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.4.4 + *) mod_dumpio: Correctly log large messages + PR 54179 [Marek Wianecki ] + *) core: Don't fail at startup with AH00554 when Include points to a directory without any wildcard character. [Eric Covener] diff --git a/STATUS b/STATUS index 2140ad0b08..7dfa2568f2 100644 --- a/STATUS +++ b/STATUS @@ -91,12 +91,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_dumpio: Correctly log large messages - PR 54179 - trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1412278 - 2.4.x patch: http://people.apache.org/~jailletc36/backport_mod_dumpio.patch - +1: jailletc36, sf, druggeri - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] 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 */ }; -- 2.40.0