summaryrefslogtreecommitdiffstatsabout
path: root/functions13.h
diff options
context:
space:
mode:
authorEdward Rudd <urkle@outoforder.cc>2004-02-05 21:59:47 (GMT)
committer Edward Rudd <urkle@outoforder.cc>2004-02-05 21:59:47 (GMT)
commit45220bcc856d6fa4b86e3f36eeaebd63d994f03f (patch)
tree3d7dde7606dd11a25335163284e3814b35bc7e01 /functions13.h
parent437e3890c6565b7d13c5e39ef8aa12858bfa9e4e (diff)
synchronized extract_* functions with latest apache 1.3 and 2.0.
Added some more recent extract_* functions.. still need to assign format letters cleanup/audit of extract_* functions release 1.95
Diffstat (limited to 'functions13.h')
-rw-r--r--functions13.h37
1 files changed, 28 insertions, 9 deletions
diff --git a/functions13.h b/functions13.h
index 1b85d0e..7fe8850 100644
--- a/functions13.h
+++ b/functions13.h
@@ -1,4 +1,17 @@
1/* $Header: /home/cvs/mod_log_sql/functions13.h,v 1.2 2004/01/20 19:38:08 urkle Exp $ */ 1/* $Header: /home/cvs/mod_log_sql/functions13.h,v 1.3 2004/02/05 21:59:46 urkle Exp $ */
2
3static const char *extract_bytes_sent(request_rec *r, char *a)
4{
5 if (!r->sent_bodyct) {
6 return "-";
7 }
8 else {
9 long int bs;
10 ap_bgetopt(r->connection->client, BO_BYTECT, &bs);
11 return ap_psprintf(r->pool, "%ld", bs);
12 }
13}
14
2static const char *extract_request_time(request_rec *r, char *a) 15static const char *extract_request_time(request_rec *r, char *a)
3{ 16{
4 int timz; 17 int timz;
@@ -24,16 +37,22 @@ static const char *extract_request_time(request_rec *r, char *a)
24 37
25static const char *extract_request_duration(request_rec *r, char *a) 38static const char *extract_request_duration(request_rec *r, char *a)
26{ 39{
27 char duration[22]; /* Long enough for 2^64 */ 40 return ap_psprintf(r->pool, "%ld", time(NULL) - r->request_time);
28
29 ap_snprintf(duration, sizeof(duration), "%ld", (long) time(NULL) - r->request_time);
30 return ap_pstrdup(r->pool, duration);
31} 41}
32 42
33static const char *extract_request_timestamp(request_rec *r, char *a) 43static const char *extract_request_timestamp(request_rec *r, char *a)
34{ 44{
35 char tstr[32]; 45 return ap_psprintf(r->pool, "%ld", (long) time(NULL));
36 46}
37 ap_snprintf(tstr, 32, "%ld", (long) time(NULL)); 47static const char *extract_connection_status(request_rec *r, char *a) __attribute__((unused));
38 return ap_pstrdup(r->pool, tstr); 48static const char *extract_connection_status(request_rec *r, char *a)
49{
50 if (r->connection->aborted)
51 return "X";
52
53 if ((r->connection->keepalive) &&
54 ((r->server->keep_alive_max - r->connection->keepalives) > 0)) {
55 return "+";
56 }
57 return "-";
39} 58}