1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629476 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Christophe Jaillet
2014-10-05 07:05:33 +00:00
parent ecc3c818fa
commit 642b0f1eef

View File

@@ -26,7 +26,6 @@
* It can produce a *huge* amount of data. * It can produce a *huge* amount of data.
*/ */
#include "httpd.h" #include "httpd.h"
#include "http_connection.h" #include "http_connection.h"
#include "http_config.h" #include "http_config.h"
@@ -62,8 +61,7 @@ static void dumpit(ap_filter_t *f, apr_bucket *b, dumpio_conf_t *ptr)
b->type->name, b->type->name,
b->length); b->length);
if (!(APR_BUCKET_IS_METADATA(b))) if (!(APR_BUCKET_IS_METADATA(b))) {
{
#if APR_CHARSET_EBCDIC #if APR_CHARSET_EBCDIC
char xlatebuf[dumpio_MAX_STRING_LEN + 1]; char xlatebuf[dumpio_MAX_STRING_LEN + 1];
#endif #endif
@@ -71,11 +69,10 @@ static void dumpit(ap_filter_t *f, apr_bucket *b, dumpio_conf_t *ptr)
apr_size_t nbytes; apr_size_t nbytes;
apr_status_t rv = apr_bucket_read(b, &buf, &nbytes, APR_BLOCK_READ); apr_status_t rv = apr_bucket_read(b, &buf, &nbytes, APR_BLOCK_READ);
if (rv == APR_SUCCESS) if (rv == APR_SUCCESS) {
{ while (nbytes) {
while (nbytes)
{
apr_size_t logbytes = nbytes; apr_size_t logbytes = nbytes;
if (logbytes > dumpio_MAX_STRING_LEN) if (logbytes > dumpio_MAX_STRING_LEN)
logbytes = dumpio_MAX_STRING_LEN; logbytes = dumpio_MAX_STRING_LEN;
nbytes -= logbytes; nbytes -= logbytes;
@@ -124,9 +121,9 @@ static void dumpit(ap_filter_t *f, apr_bucket *b, dumpio_conf_t *ptr)
) )
static int dumpio_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, static int dumpio_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) ap_input_mode_t mode, apr_read_type_e block,
apr_off_t readbytes)
{ {
apr_bucket *b; apr_bucket *b;
apr_status_t ret; apr_status_t ret;
conn_rec *c = f->c; conn_rec *c = f->c;
@@ -142,7 +139,9 @@ static int dumpio_input_filter (ap_filter_t *f, apr_bucket_brigade *bb,
ret = ap_get_brigade(f->next, bb, mode, block, readbytes); ret = ap_get_brigade(f->next, bb, mode, block, readbytes);
if (ret == APR_SUCCESS) { if (ret == APR_SUCCESS) {
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);
} }
} }
@@ -161,9 +160,12 @@ static int dumpio_output_filter (ap_filter_t *f, apr_bucket_brigade *bb)
conn_rec *c = f->c; conn_rec *c = f->c;
dumpio_conf_t *ptr = f->ctx; dumpio_conf_t *ptr = f->ctx;
ap_log_cerror(APLOG_MARK, APLOG_TRACE7, 0, c, "mod_dumpio: %s", f->frec->name); ap_log_cerror(APLOG_MARK, APLOG_TRACE7, 0, c, "mod_dumpio: %s",
f->frec->name);
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)) {
/* /*
* If we ever see an EOS, make sure to FLUSH. * If we ever see an EOS, make sure to FLUSH.
*/ */
@@ -208,6 +210,7 @@ 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 = 0; ptr->enable_input = 0;
ptr->enable_output = 0; ptr->enable_output = 0;
return ptr; return ptr;