mod_dumpio.c revision 0f488df653e7e8cf4ee0006a3138f9474ca1d375
/* Copyright 2004-2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed 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.
*/
/*
* Originally written @ Covalent by Jim Jagielski
*/
/*
* mod_dumpio.c:
* Think of this as a filter sniffer for Apache 2.x. It logs
* all filter data right before and after it goes out on the
* wire (BUT right before SSL encoded or after SSL decoded).
* It can produce a *huge* amount of data.
*/
#include "httpd.h"
#include "http_connection.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
typedef struct dumpio_conf_t {
int enable_input;
int enable_output;
/*
* Workhorse function: simply log to the current error_log
* info about the data in the bucket as well as the data itself
*/
{
conn_rec *c = f->c;
b->length) ;
if (!(APR_BUCKET_IS_METADATA(b))) {
const char *buf;
char *obuf;
if (nbytes) {
"mod_dumpio: %s (%s-%s): %s",
obuf);
}
} else {
"mod_dumpio: %s (%s-%s): %s",
"error reading data");
}
}
}
)
{
apr_bucket *b;
conn_rec *c = f->c;
readbytes) ;
if (ret == APR_SUCCESS) {
dumpit(f, b);
}
} else {
}
return APR_SUCCESS ;
}
{
apr_bucket *b;
conn_rec *c = f->c;
/*
* If we ever see an EOS, make sure to FLUSH.
*/
if (APR_BUCKET_IS_EOS(b)) {
}
dumpit(f, b);
}
}
{
dumpio_conf_t *ptr =
if (ptr->enable_input)
if (ptr->enable_output)
return OK;
}
static void dumpio_register_hooks(apr_pool_t *p)
{
/*
* We know that SSL is CONNECTION + 5
*/
}
{
return ptr;
}
{
dumpio_conf_t *ptr =
return NULL;
}
{
dumpio_conf_t *ptr =
return NULL;
}
static const command_rec dumpio_cmds[] = {
RSRC_CONF, "Enable I/O Dump on Input Data"),
RSRC_CONF, "Enable I/O Dump on Output Data"),
{ NULL }
};
NULL,
NULL,
NULL,
};