#endif
-
#define MIN_BW 256 /* Minimal bandwidth 256 bytes */
#define PACKET 8192 /* Default packet at 8192 bytes */
#define MAX_VHOSTS 1024 /* Default number of vhosts to show in stats */
@@ -86,25 +87,28 @@ Changelog :
/* Compatibility with regex on apache less than 2.1 */
#if !AP_MODULE_MAGIC_AT_LEAST(20050127,0)
- typedef regex_t ap_regex_t;
- #define AP_REG_EXTENDED REG_EXTENDED
- #define AP_REG_ICASE REG_ICASE
+typedef regex_t ap_regex_t;
+#define AP_REG_EXTENDED REG_EXTENDED
+#define AP_REG_ICASE REG_ICASE
#endif
/* Compatibility with obsolete ap_get_server_version() */
#if !AP_MODULE_MAGIC_AT_LEAST(20051115,4)
- #define ap_get_server_banner ap_get_server_version
+#define ap_get_server_banner ap_get_server_version
#endif
/* Compatibility for APR < 1 */
#if ( defined(APR_MAJOR_VERSION) && (APR_MAJOR_VERSION < 1) )
- #define apr_atomic_inc32 apr_atomic_inc
- #define apr_atomic_dec32 apr_atomic_dec
- #define apr_atomic_add32 apr_atomic_add
- #define apr_atomic_cas32 apr_atomic_cas
- #define apr_atomic_set32 apr_atomic_set
+#define apr_atomic_inc32 apr_atomic_inc
+#define apr_atomic_dec32 apr_atomic_dec
+#define apr_atomic_add32 apr_atomic_add
+#define apr_atomic_cas32 apr_atomic_cas
+#define apr_atomic_set32 apr_atomic_set
#endif
+
+#pragma message("This file is: " __FILE__)
+
/* Enum types of "from address" */
enum from_type {
T_ALL,
@@ -113,7 +117,7 @@ enum from_type {
T_AGENT
};
-/*
+/*
- Stats of each conf
-
- id = Configuration ID
@@ -130,7 +134,7 @@ typedef struct
char *v_name;
apr_uint32_t connection_count;
apr_uint32_t bandwidth;
- apr_uint32_t bytes_count;
+ unsigned long long bytes_count;
apr_uint32_t counter;
volatile apr_uint32_t lock;
apr_time_t time;
@@ -141,16 +145,18 @@ typedef struct ctx_struct_t
{
apr_bucket_brigade *bb;
struct timeval wait;
+ unsigned long long bw_interval_bytes, client_bw;
+ apr_time_t bw_interval_start_time;
+ long sleep_bypasses_left, sleep_bypasses_total;
} ctx_struct;
-/* With sid we count the shared memory needed.
+/* With sid we count the shared memory needed.
BwBase, is a holder to the shared memory base addres */
static char *vnames[MAX_VHOSTS];
static int sid = 0;
bw_data *bwbase;
apr_shm_t *shm;
-
/* Limits for MaxConnections based on directory */
typedef struct
{
@@ -193,7 +199,7 @@ typedef struct
apr_array_header_t *minlimits;
apr_array_header_t *sizelimits;
apr_array_header_t *maxconnection;
- int packet;
+ unsigned int packet;
int error;
char *directory;
} bandwidth_config;
@@ -211,39 +217,39 @@ module AP_MODULE_DECLARE_DATA bw_module;
/*---------------------------------------------------------------------*
* Configurations Directives *
*---------------------------------------------------------------------*/
-/* Set the mod enabled ... or disabled */
-static const char *bandwidthmodule(cmd_parms * cmd, void *dconf, int flag)
+ /* Set the mod enabled ... or disabled */
+static const char *bandwidthmodule(cmd_parms *cmd, void *dconf, int flag)
{
bandwidth_server_config *sconf;
sconf =
- (bandwidth_server_config *) ap_get_module_config(cmd->server->
- module_config,
- &bw_module);
+ (bandwidth_server_config *)ap_get_module_config(cmd->server->
+ module_config,
+ &bw_module);
sconf->state = (flag ? BANDWIDTH_ENABLED : BANDWIDTH_DISABLED);
return NULL;
}
/* Set force mode enabled ... or disabled */
-static const char *forcebandwidthmodule(cmd_parms * cmd, void *dconf,
- int flag)
+static const char *forcebandwidthmodule(cmd_parms *cmd, void *dconf,
+ int flag)
{
bandwidth_server_config *sconf;
sconf =
- (bandwidth_server_config *) ap_get_module_config(cmd->server->
- module_config,
- &bw_module);
+ (bandwidth_server_config *)ap_get_module_config(cmd->server->
+ module_config,
+ &bw_module);
sconf->force = (flag ? BANDWIDTH_ENABLED : BANDWIDTH_DISABLED);
return NULL;
}
/* Set the packetsize used in the context */
-static const char *setpacket(cmd_parms * cmd, void *s, const char *pack)
+static const char *setpacket(cmd_parms *cmd, void *s, const char *pack)
{
- bandwidth_config *conf = (bandwidth_config *) s;
+ bandwidth_config *conf = (bandwidth_config *)s;
int temp;
if (pack && *pack && apr_isdigit(*pack))
@@ -260,9 +266,9 @@ static const char *setpacket(cmd_parms * cmd, void *s, const char *pack)
}
/* Set the error to send when maxconnections is reached */
-static const char *bandwidtherror(cmd_parms * cmd, void *s, const char *err)
+static const char *bandwidtherror(cmd_parms *cmd, void *s, const char *err)
{
- bandwidth_config *conf = (bandwidth_config *) s;
+ bandwidth_config *conf = (bandwidth_config *)s;
int temp;
if (err && *err && apr_isdigit(*err))
@@ -279,14 +285,14 @@ static const char *bandwidtherror(cmd_parms * cmd, void *s, const char *err)
}
/* Set the maxconnections on a per host basis */
-static const char *maxconnection(cmd_parms * cmd, void *s, const char *from,
- const char *maxc)
+static const char *maxconnection(cmd_parms *cmd, void *s, const char *from,
+ const char *maxc)
{
- bandwidth_config *conf = (bandwidth_config *) s;
+ bandwidth_config *conf = (bandwidth_config *)s;
bw_maxconn *a;
int temp;
char *str;
- char *where = (char *) apr_pstrdup(cmd->pool, from);
+ char *where = (char *)apr_pstrdup(cmd->pool, from);
apr_status_t rv;
char msgbuf[MAX_BUF];
@@ -297,19 +303,19 @@ static const char *maxconnection(cmd_parms * cmd, void *s, const char *from,
if (temp < 0)
return
- "Connections must be a number of simultaneous connections allowed/s";
+ "Connections must be a number of simultaneous connections allowed/s";
- a = (bw_maxconn *) apr_array_push(conf->maxconnection);
+ a = (bw_maxconn *)apr_array_push(conf->maxconnection);
a->x.from = where;
- if (!strncasecmp(where,"u:",2))
- {
+ if (!strncasecmp(where, "u:", 2))
+ {
/* Do not limit based on origin, but on user agent */
a->type = T_AGENT;
- a->agent = ap_pregcomp(cmd->pool, where+2, 0);
+ a->agent = ap_pregcomp(cmd->pool, where + 2, 0);
if (a->agent == NULL)
return "Regular expression could not be compiled.";
-
+
}
else if (!strcasecmp(where, "all")) {
a->type = T_ALL;
@@ -317,7 +323,7 @@ static const char *maxconnection(cmd_parms * cmd, void *s, const char *from,
else if ((str = strchr(where, '/'))) {
*str++ = '\0';
rv = apr_ipsubnet_create(&a->x.ip, where, str, cmd->pool);
- if(APR_STATUS_IS_EINVAL(rv)) {
+ if (APR_STATUS_IS_EINVAL(rv)) {
/* looked nothing like an IP address */
return "An IP address was expected";
}
@@ -326,14 +332,14 @@ static const char *maxconnection(cmd_parms * cmd, void *s, const char *from,
return apr_pstrdup(cmd->pool, msgbuf);
}
a->type = T_IP;
- }
+ }
else if (!APR_STATUS_IS_EINVAL(rv = apr_ipsubnet_create(&a->x.ip, where, NULL, cmd->pool))) {
if (rv != APR_SUCCESS) {
apr_strerror(rv, msgbuf, sizeof msgbuf);
return apr_pstrdup(cmd->pool, msgbuf);
}
a->type = T_IP;
- }
+ }
else { /* no slash, didn't look like an IP address => must be a host */
a->type = T_HOST;
}
@@ -344,14 +350,14 @@ static const char *maxconnection(cmd_parms * cmd, void *s, const char *from,
}
/* Set the bandwidth on a per host basis */
-static const char *bandwidth(cmd_parms * cmd, void *s, const char *from,
- const char *bw)
+static const char *bandwidth(cmd_parms *cmd, void *s, const char *from,
+ const char *bw)
{
- bandwidth_config *conf = (bandwidth_config *) s;
+ bandwidth_config *conf = (bandwidth_config *)s;
bw_entry *a;
long int temp;
char *str;
- char *where = (char *) apr_pstrdup(cmd->pool, from);
+ char *where = (char *)apr_pstrdup(cmd->pool, from);
apr_status_t rv;
char msgbuf[MAX_BUF];
@@ -364,16 +370,16 @@ static const char *bandwidth(cmd_parms * cmd, void *s, const char *from,
if (temp < 0)
return "BandWidth must be a number of bytes/s";
- a = (bw_entry *) apr_array_push(conf->limits);
+ a = (bw_entry *)apr_array_push(conf->limits);
a->x.from = where;
- if (!strncasecmp(where,"u:",2))
+ if (!strncasecmp(where, "u:", 2))
{
/* Do not limit based on origin, but on user agent */
a->type = T_AGENT;
- a->agent = ap_pregcomp(cmd->pool, where+2, 0);
+ a->agent = ap_pregcomp(cmd->pool, where + 2, 0);
if (a->agent == NULL)
- return "Regular expression could not be compiled.";
-
+ return "Regular expression could not be compiled.";
+
}
else if (!strcasecmp(where, "all")) {
a->type = T_ALL;
@@ -381,7 +387,7 @@ static const char *bandwidth(cmd_parms * cmd, void *s, const char *from,
else if ((str = strchr(where, '/'))) {
*str++ = '\0';
rv = apr_ipsubnet_create(&a->x.ip, where, str, cmd->pool);
- if(APR_STATUS_IS_EINVAL(rv)) {
+ if (APR_STATUS_IS_EINVAL(rv)) {
/* looked nothing like an IP address */
return "An IP address was expected";
}
@@ -403,25 +409,23 @@ static const char *bandwidth(cmd_parms * cmd, void *s, const char *from,
}
if (sid < MAX_VHOSTS)
{
- vnames[sid] = apr_pcalloc(cmd->pool,apr_snprintf(msgbuf,MAX_BUF,"%s,%s",cmd->server->server_hostname,where) );
- vnames[sid] = (char *) apr_pstrdup(cmd->pool, msgbuf);
+ vnames[sid] = apr_pcalloc(cmd->pool, apr_snprintf(msgbuf, MAX_BUF, "%s,%s", cmd->server->server_hostname, where));
+ vnames[sid] = (char *)apr_pstrdup(cmd->pool, msgbuf);
}
a->rate = temp;
a->sid = sid++;
-
return NULL;
}
/* Set the minimum bandwidth to send */
-static const char *minbandwidth(cmd_parms * cmd, void *s, const char *from,
- const char *bw)
+static const char *minbandwidth(cmd_parms *cmd, void *s, const char *from, const char *bw)
{
- bandwidth_config *conf = (bandwidth_config *) s;
+ bandwidth_config *conf = (bandwidth_config *)s;
bw_entry *a;
long int temp;
char *str;
- char *where = (char *) apr_pstrdup(cmd->pool, from);
+ char *where = (char *)apr_pstrdup(cmd->pool, from);
apr_status_t rv;
char msgbuf[MAX_BUF];
@@ -430,13 +434,13 @@ static const char *minbandwidth(cmd_parms * cmd, void *s, const char *from,
else
return "Invalid argument";
- a = (bw_entry *) apr_array_push(conf->minlimits);
+ a = (bw_entry *)apr_array_push(conf->minlimits);
a->x.from = where;
- if (!strncasecmp(where,"u:",2))
+ if (!strncasecmp(where, "u:", 2))
{
/* Do not limit based on origin, but on user agent */
a->type = T_AGENT;
- a->agent = ap_pregcomp(cmd->pool, where+2, 0);
+ a->agent = ap_pregcomp(cmd->pool, where + 2, 0);
if (a->agent == NULL)
return "Regular expression could not be compiled.";
@@ -447,7 +451,7 @@ static const char *minbandwidth(cmd_parms * cmd, void *s, const char *from,
else if ((str = strchr(where, '/'))) {
*str++ = '\0';
rv = apr_ipsubnet_create(&a->x.ip, where, str, cmd->pool);
- if(APR_STATUS_IS_EINVAL(rv)) {
+ if (APR_STATUS_IS_EINVAL(rv)) {
/* looked nothing like an IP address */
return "An IP address was expected";
}
@@ -474,10 +478,10 @@ static const char *minbandwidth(cmd_parms * cmd, void *s, const char *from,
}
/* Set the large file bandwidth limit */
-static const char *largefilelimit(cmd_parms * cmd, void *s, const char *file,
- const char *size, const char *bw)
+static const char *largefilelimit(cmd_parms *cmd, void *s, const char *file,
+ const char *size, const char *bw)
{
- bandwidth_config *conf = (bandwidth_config *) s;
+ bandwidth_config *conf = (bandwidth_config *)s;
bw_sizel *a;
long int temp, tsize;
char msgbuf[MAX_BUF];
@@ -501,14 +505,14 @@ static const char *largefilelimit(cmd_parms * cmd, void *s, const char *file,
if (tsize < 0)
return "File size must be a number of Kbytes";
- a = (bw_sizel *) apr_array_push(conf->sizelimits);
- a->file = (char *) file;
+ a = (bw_sizel *)apr_array_push(conf->sizelimits);
+ a->file = (char *)file;
a->size = tsize;
a->rate = temp;
if (sid < MAX_VHOSTS)
{
- vnames[sid] = apr_pcalloc(cmd->pool,apr_snprintf(msgbuf,MAX_BUF,"%s,%s",cmd->server->server_hostname,file) );
- vnames[sid] = (char *) apr_pstrdup(cmd->pool, msgbuf);
+ vnames[sid] = apr_pcalloc(cmd->pool, apr_snprintf(msgbuf, MAX_BUF, "%s,%s", cmd->server->server_hostname, file));
+ vnames[sid] = (char *)apr_pstrdup(cmd->pool, msgbuf);
}
a->sid = sid++;
@@ -520,11 +524,11 @@ static const char *largefilelimit(cmd_parms * cmd, void *s, const char *file,
* Helper Functions *
*----------------------------------------------------------------------------*/
-/* Match the input, as part of a domain */
+ /* Match the input, as part of a domain */
static int in_domain(const char *domain, const char *what)
{
- int dl = strlen(domain);
- int wl = strlen(what);
+ size_t dl = strlen(domain);
+ size_t wl = strlen(what);
if ((wl - dl) >= 0) {
if (strcasecmp(domain, &what[wl - dl]) != 0)
@@ -544,9 +548,9 @@ static int in_domain(const char *domain, const char *what)
}
/* Get the bandwidth limit based on from address */
-static long get_bw_rate(request_rec * r, apr_array_header_t * a)
+static long get_bw_rate(request_rec *r, apr_array_header_t *a)
{
- bw_entry *e = (bw_entry *) a->elts;
+ bw_entry *e = (bw_entry *)a->elts;
const char *remotehost = NULL;
int i;
int gothost = 0;
@@ -557,14 +561,14 @@ static long get_bw_rate(request_rec * r, apr_array_header_t * a)
switch (e[i].type) {
case T_AGENT:
uastr = apr_table_get(r->headers_in, "User-Agent");
- if (e[i].agent && uastr && ap_regexec(e[i].agent, uastr, 0, NULL, 0)==0 )
+ if (e[i].agent && uastr && ap_regexec(e[i].agent, uastr, 0, NULL, 0) == 0)
return (e[i].rate);
break;
case T_ALL:
return e[i].rate;
case T_IP:
- if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->client_addr)) {
return e[i].rate;
}
break;
@@ -573,7 +577,7 @@ static long get_bw_rate(request_rec * r, apr_array_header_t * a)
int remotehost_is_ip;
remotehost = ap_get_remote_host(r->connection, r->per_dir_config,
- REMOTE_DOUBLE_REV, &remotehost_is_ip);
+ REMOTE_DOUBLE_REV, &remotehost_is_ip);
if ((remotehost == NULL) || remotehost_is_ip)
gothost = 1;
@@ -585,14 +589,14 @@ static long get_bw_rate(request_rec * r, apr_array_header_t * a)
return (e[i].rate);
break;
}
-
+
}
return 0;
}
-/*
- Match the pattern with the last digist from filename
- An asterisk means any.
+/*
+ Match the pattern with the last digist from filename
+ An asterisk means any.
*/
static int match_ext(const char *file, char *match)
{
@@ -611,10 +615,10 @@ static int match_ext(const char *file, char *match)
}
/* Get the bandwidth limit based on filesize */
-static long get_bw_filesize(request_rec * r, apr_array_header_t * a,
- apr_uint32_t filesize, const char *filename)
+static long get_bw_filesize(request_rec *r, apr_array_header_t *a,
+ apr_uint32_t filesize, const char *filename)
{
- bw_sizel *e = (bw_sizel *) a->elts;
+ bw_sizel *e = (bw_sizel *)a->elts;
int i;
apr_uint32_t tmpsize = 0, tmprate = 0;
@@ -635,9 +639,9 @@ static long get_bw_filesize(request_rec * r, apr_array_header_t * a,
}
/* Get the MaxConnections allowed */
-static int get_maxconn(request_rec * r, apr_array_header_t * a)
+static int get_maxconn(request_rec *r, apr_array_header_t *a)
{
- bw_maxconn *e = (bw_maxconn *) a->elts;
+ bw_maxconn *e = (bw_maxconn *)a->elts;
const char *remotehost = NULL;
int i;
int gothost = 0;
@@ -648,14 +652,14 @@ static int get_maxconn(request_rec * r, apr_array_header_t * a)
switch (e[i].type) {
case T_AGENT:
uastr = apr_table_get(r->headers_in, "User-Agent");
- if (e[i].agent && uastr && ap_regexec(e[i].agent, uastr, 0, NULL, 0)==0 )
+ if (e[i].agent && uastr && ap_regexec(e[i].agent, uastr, 0, NULL, 0) == 0)
return (e[i].max);
break;
case T_ALL:
return e[i].max;
case T_IP:
- if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->client_addr)) {
return e[i].max;
}
break;
@@ -664,7 +668,7 @@ static int get_maxconn(request_rec * r, apr_array_header_t * a)
int remotehost_is_ip;
remotehost = ap_get_remote_host(r->connection, r->per_dir_config,
- REMOTE_DOUBLE_REV, &remotehost_is_ip);
+ REMOTE_DOUBLE_REV, &remotehost_is_ip);
if ((remotehost == NULL) || remotehost_is_ip)
gothost = 1;
@@ -682,9 +686,9 @@ static int get_maxconn(request_rec * r, apr_array_header_t * a)
}
/* Get an id based on bandwidth limit */
-static int get_sid(request_rec * r, apr_array_header_t * a)
+static int get_sid(request_rec *r, apr_array_header_t *a)
{
- bw_entry *e = (bw_entry *) a->elts;
+ bw_entry *e = (bw_entry *)a->elts;
const char *remotehost = NULL;
int i;
int gothost = 0;
@@ -692,21 +696,21 @@ static int get_sid(request_rec * r, apr_array_header_t * a)
remotehost =
ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_HOST,
- NULL);
+ NULL);
for (i = 0; i < a->nelts; i++) {
switch (e[i].type) {
case T_AGENT:
uastr = apr_table_get(r->headers_in, "User-Agent");
- if (e[i].agent && uastr && ap_regexec(e[i].agent, uastr, 0, NULL, 0)==0 )
+ if (e[i].agent && uastr && ap_regexec(e[i].agent, uastr, 0, NULL, 0) == 0)
return (e[i].sid);
break;
case T_ALL:
return e[i].sid;
case T_IP:
- if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->client_addr)) {
return e[i].sid;
}
break;
@@ -715,7 +719,7 @@ static int get_sid(request_rec * r, apr_array_header_t * a)
int remotehost_is_ip;
remotehost = ap_get_remote_host(r->connection, r->per_dir_config,
- REMOTE_DOUBLE_REV, &remotehost_is_ip);
+ REMOTE_DOUBLE_REV, &remotehost_is_ip);
if ((remotehost == NULL) || remotehost_is_ip)
gothost = 1;
@@ -733,10 +737,10 @@ static int get_sid(request_rec * r, apr_array_header_t * a)
}
/* Get an id based on filesize limit */
-static int get_f_sid(request_rec * r, apr_array_header_t * a, apr_uint32_t filesize,
- const char *filename)
+static int get_f_sid(request_rec *r, apr_array_header_t *a, apr_uint32_t filesize,
+ const char *filename)
{
- bw_sizel *e = (bw_sizel *) a->elts;
+ bw_sizel *e = (bw_sizel *)a->elts;
int i;
apr_uint32_t tmpsize = 0, tmpsid = -1;
@@ -759,7 +763,7 @@ static int get_f_sid(request_rec * r, apr_array_header_t * a, apr_uint32_t files
}
/* Update memory (shm) counters, which holds the bw data per context */
-static void update_counters(bw_data * bwstat, ap_filter_t * f)
+static void update_counters(bw_data *bwstat, ap_filter_t *f)
{
apr_time_t nowtime;
@@ -770,8 +774,8 @@ static void update_counters(bw_data * bwstat, ap_filter_t * f)
if (apr_atomic_cas32(&bwstat->lock, 1, 0) == 0) {
/* Calculate bw used in the last timeinterval */
- bwstat->bandwidth = (apr_uint32_t) (
- (bwstat->bytes_count / (double) (nowtime - bwstat->time)) *
+ bwstat->bandwidth = (apr_uint32_t)(
+ (bwstat->bytes_count / (double)(nowtime - bwstat->time)) *
1000000);
/* Reset counters */
@@ -786,7 +790,7 @@ static void update_counters(bw_data * bwstat, ap_filter_t * f)
}
}
-static int callback(request_rec * r)
+static int callback(request_rec *r)
{
int t;
bw_data *bwstat;
@@ -795,20 +799,20 @@ static int callback(request_rec * r)
return OK;
}
- if (r->args && !strncasecmp(r->args,"csv",3))
+ if (r->args && !strncasecmp(r->args, "csv", 3))
{
ap_set_content_type(r, "text/plain");
- ap_rputs("id,vhost,scope,lock,count,bw,bytes,hits\n",r);
-
+ ap_rputs("id,vhost,scope,lock,count,bw,bytes,hits\n", r);
+
for (t = 0; t < sid; t++) {
bwstat = bwbase + t;
- ap_rprintf(r,"%d,%s,%d,%d,%d,%d,%d\n",t,bwstat->v_name,bwstat->lock,bwstat->connection_count,bwstat->bandwidth,bwstat->bytes_count,bwstat->counter);
+ ap_rprintf(r, "%d,%s,%d,%d,%d,%d,%d\n", t, bwstat->v_name, bwstat->lock, bwstat->connection_count, bwstat->bandwidth, bwstat->bytes_count, bwstat->counter);
}
return OK;
}
-
+
ap_set_content_type(r, "text/html");
ap_rputs(DOCTYPE_HTML_3_2, r);
@@ -821,7 +825,7 @@ static int callback(request_rec * r)
ap_rputs(" \n", r);
ap_rputs(" \n", r);
ap_rprintf(r, " Apache HTTP Server version: \"%s\"\n",
- ap_get_server_banner());
+ ap_get_server_banner());
ap_rputs("
\n", r);
ap_rprintf(r, " Server built: \"%s\"\n", ap_get_server_built());
ap_rputs("
\n", r);;
@@ -831,47 +835,44 @@ static int callback(request_rec * r)
bwstat = bwbase + t;
/* This inits the struct that will contain current bw use */
- ap_rputs("
",r);
- ap_rprintf(r,"id : %d
",t);
- ap_rprintf(r,"name : %s
",bwstat->v_name);
- ap_rprintf(r,"lock : %d
",bwstat->lock);
- ap_rprintf(r,"count: %d
",bwstat->connection_count);
- ap_rprintf(r,"bw : %d
",bwstat->bandwidth);
- ap_rprintf(r,"bytes: %d
",bwstat->bytes_count);
- ap_rprintf(r,"hits : %d
",bwstat->counter);
+ ap_rputs("
", r);
+ ap_rprintf(r, "id : %d
", t);
+ ap_rprintf(r, "name : %s
", bwstat->v_name);
+ ap_rprintf(r, "lock : %d
", bwstat->lock);
+ ap_rprintf(r, "count: %d
", bwstat->connection_count);
+ ap_rprintf(r, "bw : %d
", bwstat->bandwidth);
+ ap_rprintf(r, "bytes: %d
", bwstat->bytes_count);
+ ap_rprintf(r, "hits : %d
", bwstat->counter);
}
ap_rputs("