]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/log/FormatSquidReferer.cc
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 46 Access Log - Squid referer format */
12 #include "AccessLogEntry.h"
13 #include "HttpRequest.h"
15 #include "log/Formats.h"
16 #include "SquidTime.h"
19 Log::Format::SquidReferer(const AccessLogEntry::Pointer
&al
, Logfile
*logfile
)
21 const char *referer
= NULL
;
23 referer
= al
->request
->header
.getStr(Http::HdrType::REFERER
);
25 if (!referer
|| *referer
== '\0')
28 char clientip
[MAX_IPSTRLEN
];
29 al
->getLogClientIp(clientip
, MAX_IPSTRLEN
);
31 const SBuf url
= !al
->url
.isEmpty() ? al
->url
: ::Format::Dash
;
33 logfilePrintf(logfile
, "%9ld.%03d %s %s " SQUIDSBUFPH
"\n",
34 (long int) current_time
.tv_sec
,
35 (int) current_time
.tv_usec
/ 1000,