From 40f0c8fe04858acd724d6221dbf8a357259e5d6b Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Tue, 20 Jan 2004 16:27:35 +0000 Subject: split out version specific code code compiles under apache 1.3 and 2.0 updated apache m4 script to detect both verions (two minumums) defaulted install to not activate module in configuration file (use make activate) --- (limited to 'functions13.h') diff --git a/functions13.h b/functions13.h new file mode 100644 index 0000000..bff37f2 --- /dev/null +++ b/functions13.h @@ -0,0 +1,38 @@ +static const char *extract_request_time(request_rec *r, char *a) +{ + int timz; + struct tm *t; + char tstr[MAX_STRING_LEN]; + + t = ap_get_gmtoff(&timz); + + if (a && *a) { /* Custom format */ + strftime(tstr, MAX_STRING_LEN, a, t); + } else { /* CLF format */ + char sign = (timz < 0 ? '-' : '+'); + + if (timz < 0) { + timz = -timz; + } + strftime(tstr, MAX_STRING_LEN, "[%d/%b/%Y:%H:%M:%S ", t); + ap_snprintf(tstr + strlen(tstr), sizeof(tstr) - strlen(tstr), "%c%.2d%.2d]", sign, timz / 60, timz % 60); + } + + return ap_pstrdup(r->pool, tstr); +} + +static const char *extract_request_duration(request_rec *r, char *a) +{ + char duration[22]; /* Long enough for 2^64 */ + + ap_snprintf(duration, sizeof(duration), "%ld", (long) time(NULL) - r->request_time); + return ap_pstrdup(r->pool, duration); +} + +static const char *extract_request_timestamp(request_rec *r, char *a) +{ + char tstr[32]; + + ap_snprintf(tstr, 32, "%ld", (long) time(NULL)); + return ap_pstrdup(r->pool, tstr); +} -- cgit v0.9.2