mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
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
This commit is contained in:
@@ -45,7 +45,7 @@ typedef struct dumpio_conf_t {
|
|||||||
* line length of all \xNN sequences; log_error cannot record more
|
* line length of all \xNN sequences; log_error cannot record more
|
||||||
* than MAX_STRING_LEN characters.
|
* 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
|
* 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",
|
(APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data",
|
||||||
b->type->name, (int)logbytes, buf);
|
b->type->name, (int)logbytes, buf);
|
||||||
#endif
|
#endif
|
||||||
|
buf += logbytes;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
ap_log_cerror(APLOG_MARK, APLOG_TRACE7, rv, c,
|
ap_log_cerror(APLOG_MARK, APLOG_TRACE7, rv, c,
|
||||||
"mod_dumpio: %s (%s-%s): %s", f->frec->name,
|
"mod_dumpio: %s (%s-%s): %s", f->frec->name,
|
||||||
(APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data",
|
(APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data",
|
||||||
@@ -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)) {
|
for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) {
|
||||||
dumpit(f, b, ptr);
|
dumpit(f, b, ptr);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
ap_log_cerror(APLOG_MARK, APLOG_TRACE7, 0, c,
|
ap_log_cerror(APLOG_MARK, APLOG_TRACE7, 0, c,
|
||||||
"mod_dumpio: %s - %d", f->frec->name, ret) ;
|
"mod_dumpio: %s - %d", f->frec->name, ret) ;
|
||||||
return ret;
|
return ret;
|
||||||
@@ -205,14 +208,14 @@ static void dumpio_register_hooks(apr_pool_t *p)
|
|||||||
static void *dumpio_create_sconfig(apr_pool_t *p, server_rec *s)
|
static void *dumpio_create_sconfig(apr_pool_t *p, server_rec *s)
|
||||||
{
|
{
|
||||||
dumpio_conf_t *ptr = apr_pcalloc(p, sizeof *ptr);
|
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;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *dumpio_enable_input(cmd_parms *cmd, void *dummy, int arg)
|
static const char *dumpio_enable_input(cmd_parms *cmd, void *dummy, int arg)
|
||||||
{
|
{
|
||||||
dumpio_conf_t *ptr =
|
dumpio_conf_t *ptr = ap_get_module_config(cmd->server->module_config,
|
||||||
(dumpio_conf_t *) ap_get_module_config(cmd->server->module_config,
|
|
||||||
&dumpio_module);
|
&dumpio_module);
|
||||||
|
|
||||||
ptr->enable_input = arg;
|
ptr->enable_input = arg;
|
||||||
@@ -221,8 +224,7 @@ 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)
|
static const char *dumpio_enable_output(cmd_parms *cmd, void *dummy, int arg)
|
||||||
{
|
{
|
||||||
dumpio_conf_t *ptr =
|
dumpio_conf_t *ptr = ap_get_module_config(cmd->server->module_config,
|
||||||
(dumpio_conf_t *) ap_get_module_config(cmd->server->module_config,
|
|
||||||
&dumpio_module);
|
&dumpio_module);
|
||||||
|
|
||||||
ptr->enable_output = arg;
|
ptr->enable_output = arg;
|
||||||
@@ -239,10 +241,10 @@ static const command_rec dumpio_cmds[] = {
|
|||||||
|
|
||||||
AP_DECLARE_MODULE(dumpio) = {
|
AP_DECLARE_MODULE(dumpio) = {
|
||||||
STANDARD20_MODULE_STUFF,
|
STANDARD20_MODULE_STUFF,
|
||||||
NULL,
|
NULL, /* create per-dir config structures */
|
||||||
NULL,
|
NULL, /* merge per-dir config structures */
|
||||||
dumpio_create_sconfig,
|
dumpio_create_sconfig, /* create per-server config structures */
|
||||||
NULL,
|
NULL, /* merge per-server config structures */
|
||||||
dumpio_cmds,
|
dumpio_cmds, /* table of config file commands */
|
||||||
dumpio_register_hooks
|
dumpio_register_hooks /* register hooks */
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user