diff options
Diffstat (limited to 'functions13.h')
-rw-r--r-- | functions13.h | 37 |
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 | |||
3 | static 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 | |||
2 | static const char *extract_request_time(request_rec *r, char *a) | 15 | static 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 | ||
25 | static const char *extract_request_duration(request_rec *r, char *a) | 38 | static 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 | ||
33 | static const char *extract_request_timestamp(request_rec *r, char *a) | 43 | static 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)); | 47 | static const char *extract_connection_status(request_rec *r, char *a) __attribute__((unused)); |
38 | return ap_pstrdup(r->pool, tstr); | 48 | static 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 | } |