44#include <unordered_map>
48using HeaderValueCountsElement = std::pair<const SBuf, uint64_t>;
53static HeaderValueCounts TheViaCounts;
55static HeaderValueCounts TheForwardedCounts;
57static OBJH fvdbDumpVia;
58static OBJH fvdbDumpForwarded;
59static void fvdbClear(
void);
60static void fvdbRegisterWithCacheManager();
122 fatalf(
"Unknown log format %d\n",
log->type);
166 log->logfile =
nullptr;
176 peer_reply_status(
Http::scNone),
253 tvSub(responseTime, last_write, last_read);
257 if (responseTime.tv_sec < 0) {
258 responseTime.tv_sec = 0;
259 responseTime.tv_usec = 0;
269 fvdbRegisterWithCacheManager();
296 for (
Format::Token * curr_token = (
log->logFormat?
log->logFormat->format:
nullptr); curr_token; curr_token = curr_token->
next) {
318fvdbRegisterWithCacheManager(
void)
322 fvdbDumpForwarded, 0, 1);
328 ++TheViaCounts[headerValue];
334 ++TheForwardedCounts[key];
341 for (
const auto &i :
counts)
342 os <<
std::setw(9) << i.second <<
' ' << i.first <<
"\n";
349 fvdbDumpCounts(*e, TheViaCounts);
356 fvdbDumpCounts(*e, TheForwardedCounts);
362 TheViaCounts.clear();
363 TheForwardedCounts.clear();
void accessLogLog(const AccessLogEntryPointer &al, ACLChecklist *checklist)
void accessLogClose(void)
void accessLogLogTo(CustomLog *log, const AccessLogEntryPointer &al, ACLChecklist *checklist)
static void accessLogRegisterWithCacheManager(void)
void accessLogRotate(void)
void fvdbCountVia(const SBuf &)
void fvdbCountForwarded(const SBuf &)
count occurrences of the given X-Forwarded-For header value
void log(char *format,...)
static char server[MAXLINE]
Acl::Answer const & fastCheck()
const char * content_type
class AccessLogEntry::HttpDetails http
static Notes & metaHeaders()
The list of configured meta headers.
CachePeer * getPeer() const
char host[SQUIDHOSTNAMELEN]
struct timeval peer_select_start
void clearPeerNotes()
forget previous notePeerRead() and notePeerWrite() calls (if any)
struct timeval peer_last_write_
time of the last write to the last peer
struct timeval store_complete_stop
int64_t bodyBytesRead
number of body bytes received from the next hop or -1
Comm::ConnectionPointer tcpServer
TCP/IP level details of the last peer/server connection.
char cd_host[SQUIDHOSTNAMELEN]
bool peerResponseTime(struct timeval &responseTime)
struct timeval peer_last_read_
time of the last read from the last peer
void resetPeerNotes(const Comm::ConnectionPointer &server, const char *requestedHost)
STL Allocator that uses Squid memory pools for memory management.
struct SquidConfig::@82 Log
void fatalf(const char *fmt,...)
void logfileLineEnd(Logfile *lf)
void logfileLineStart(Logfile *lf)
void logfileClose(Logfile *lf)
Logfile * logfileOpen(const char *path, size_t bufsz, int fatal_flag)
void RegisterAction(char const *action, char const *desc, OBJH *handler, Protected, Atomic, Format)
static StoreRebuildData counts
void tvSub(struct timeval &res, struct timeval const &t1, struct timeval const &t2)
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
char * xstrncpy(char *dst, const char *src, size_t n)