mod_logio.c revision 67a4d05bab3fc19c1b87fb9042977975bf27cdbd
/* Copyright 2002-2004 The Apache Software Foundation
*
* 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.
*/
/*
* Written by Bojan Smojver <bojan rexursive.com>:
*
* The argument to LogFormat and CustomLog is a string, which can include
* literal characters copied into the log files, and '%' directives as
* follows:
*
* %...I: bytes received, including request and headers, cannot be zero
* %...O: bytes sent, including headers, cannot be zero
*
*/
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_hash.h"
#include "apr_optional.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#include "ap_config.h"
#include "mod_log_config.h"
#include "httpd.h"
#include "http_core.h"
#include "http_config.h"
#include "http_connection.h"
#include "http_protocol.h"
static const char logio_filter_name[] = "LOG_INPUT_OUTPUT";
/*
* Logging of input and output config...
*/
typedef struct logio_config_t {
/*
* Optional function for the core to add to bytes_out
*/
}
/*
* Format items...
*/
static const char *log_bytes_in(request_rec *r, char *a)
{
&logio_module);
}
static const char *log_bytes_out(request_rec *r, char *a)
{
&logio_module);
}
/*
* Reset counters after logging...
*/
static int logio_transaction(request_rec *r)
{
&logio_module);
return OK;
}
/*
* Logging of input and output filters...
*/
if (length > 0)
return status;
}
apr_bucket_brigade *bb) {
/* End of data, make sure we flush */
if (APR_BUCKET_IS_EOS(b)) {
apr_bucket_flush_create(f->c->bucket_alloc));
}
}
/*
* The hooks...
*/
return OK;
}
{
if (log_pfn_register) {
}
return OK;
}
static void register_hooks(apr_pool_t *p)
{
AP_FTYPE_NETWORK - 1);
AP_FTYPE_NETWORK - 1);
}
{
NULL, /* create per-dir config */
NULL, /* merge per-dir config */
NULL, /* server config */
NULL, /* merge server config */
NULL, /* command apr_table_t */
register_hooks /* register hooks */
};