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