mod_logio.c revision 8dafcef6cd2a5b17ef2e7cc799942ea724a87e87
/* 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.
*/
/*
* 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
*/
}
/*
* Optional function for modules to adjust bytes_in
*/
}
/*
* 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 filter...
*/
if (length > 0)
return status;
}
/*
* The hooks...
*/
return OK;
}
{
if (log_pfn_register) {
}
return OK;
}
static void register_hooks(apr_pool_t *p)
{
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 */
};