]>
Commit | Line | Data |
---|---|---|
ecb6baf5 JB |
1 | diff -Nur squid-2.5.STABLE4.orig/src/access_log.c squid-2.5.STABLE4/src/access_log.c |
2 | --- squid-2.5.STABLE4.orig/src/access_log.c 2003-07-28 10:59:28.000000000 +0200 | |
3 | +++ squid-2.5.STABLE4/src/access_log.c 2004-01-24 19:52:12.000000000 +0100 | |
4 | @@ -268,24 +268,32 @@ | |
5 | { | |
6 | const char *client = NULL; | |
7 | char *user1 = NULL, *user2 = NULL; | |
8 | + request_t * request = al->request; | |
9 | + const HttpHeader *req_hdr = &request->header; | |
10 | + | |
11 | if (Config.onoff.log_fqdn) | |
12 | client = fqdncache_gethostbyaddr(al->cache.caddr, 0); | |
13 | if (client == NULL) | |
14 | client = inet_ntoa(al->cache.caddr); | |
15 | user1 = accessLogFormatName(al->cache.authuser); | |
16 | user2 = accessLogFormatName(al->cache.rfc931); | |
17 | - logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %ld %s:%s", | |
18 | + | |
19 | + logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %ld \"%s\" \"%s\"", | |
20 | client, | |
21 | - user2 ? user2 : dash_str, | |
22 | - user1 ? user1 : dash_str, | |
23 | - mkhttpdlogtime(&squid_curtime), | |
24 | - al->private.method_str, | |
25 | - al->url, | |
26 | - al->http.version.major, al->http.version.minor, | |
27 | - al->http.code, | |
28 | - (long int) al->cache.size, | |
29 | - log_tags[al->cache.code], | |
30 | - hier_strings[al->hier.code]); | |
31 | + user2 ? user2 : dash_str, | |
32 | + user1 ? user1 : dash_str, | |
33 | + mkhttpdlogtime(&squid_curtime), | |
34 | + al->private.method_str, | |
35 | + (al->http_uri ? al->http_uri : al->url), | |
36 | + al->http.version.major, al->http.version.minor, | |
37 | + al->http.code, | |
38 | + (long int) al->cache.size, | |
39 | + httpHeaderHas( req_hdr, HDR_REFERER ) ? | |
40 | + httpHeaderGetStr( req_hdr, HDR_REFERER ) : | |
41 | + dash_str, // Referer if we have it, else dash_str. | |
42 | + httpHeaderHas( req_hdr, HDR_USER_AGENT ) ? | |
43 | + httpHeaderGetStr( req_hdr, HDR_USER_AGENT ) : | |
44 | + dash_str ); // User-Agent if we have it, else dash_str. | |
45 | safe_free(user1); | |
46 | safe_free(user2); | |
47 | } | |
48 | diff -Nur squid-2.5.STABLE4.orig/src/client_side.c squid-2.5.STABLE4/src/client_side.c | |
49 | --- squid-2.5.STABLE4.orig/src/client_side.c 2004-01-24 19:11:23.000000000 +0100 | |
50 | +++ squid-2.5.STABLE4/src/client_side.c 2004-01-24 19:58:22.000000000 +0100 | |
51 | @@ -845,7 +845,9 @@ | |
52 | http->al.http.method = request->method; | |
53 | http->al.http.version = request->http_ver; | |
54 | http->al.headers.request = xstrdup(mb.buf); | |
55 | - http->al.hier = request->hier; | |
56 | + http->al.hier = request->hier; /* apache-like combined-log */ | |
57 | + http->al.request = request; /* apache-like combined-log */ | |
58 | + http->al.http_uri = http->uri; /* apache-like combined-log */ | |
59 | if (request->auth_user_request) { | |
60 | if (authenticateUserRequestUsername(request->auth_user_request)) | |
61 | http->al.cache.authuser = xstrdup(authenticateUserRequestUsername(request->auth_user_request)); | |
62 | diff -Nur squid-2.5.STABLE4.orig/src/structs.h squid-2.5.STABLE4/src/structs.h | |
63 | --- squid-2.5.STABLE4.orig/src/structs.h 2004-01-24 19:11:23.000000000 +0100 | |
64 | +++ squid-2.5.STABLE4/src/structs.h 2004-01-24 19:59:56.000000000 +0100 | |
65 | @@ -1045,6 +1045,8 @@ | |
66 | struct { | |
67 | const char *method_str; | |
68 | } private; | |
69 | + request_t *request; /* apache-like combined-log */ | |
70 | + char *http_uri; /* apache-like combined-log */ | |
71 | HierarchyLogEntry hier; | |
72 | }; | |
73 |