/* 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.
*/
/*
* 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"
#include "apr_strings.h"
typedef struct dumpio_conf_t {
int enable_input;
int enable_output;
/* consider up to 80 additional characters, and factor the longest
* line length of all \xNN sequences; log_error cannot record more
* than MAX_STRING_LEN characters.
*/
/*
* 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)))
{
#endif
const char *buf;
if (rv == APR_SUCCESS)
{
while (nbytes)
{
if (logbytes > dumpio_MAX_STRING_LEN)
#else
/* XXX: Seriously flawed; we do not pay attention to embedded
* \0's in the request body, these should be escaped; however,
* the logging function already performs a significant amount
* of escaping, and so any escaping would be double-escaped.
* The coding solution is to throw away the current logic
* within ap_log_error, and introduce new vformatter %-escapes
* for escaping text, and for binary text (fixed len strings).
*/
#endif
}
}
else {
}
}
}
)
{
apr_bucket *b;
conn_rec *c = f->c;
if (ret == APR_SUCCESS) {
}
}
else {
return ret;
}
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)) {
}
}
}
{
if (ptr->enable_input)
if (ptr->enable_output)
return OK;
}
{
/*
* We know that SSL is CONNECTION + 5
*/
}
{
ptr->enable_input = 0;
ptr->enable_output = 0;
return ptr;
}
{
return NULL;
}
{
return NULL;
}
RSRC_CONF, "Enable I/O Dump on Input Data"),
RSRC_CONF, "Enable I/O Dump on Output Data"),
{ NULL }
};
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 */
};