2 * Copyright (C) 1996-2016 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 #ifndef SQUID_SRC_LOGTAGS_H
10 #define SQUID_SRC_LOGTAGS_H
12 /** Squid transaction result code/tag set.
14 * These codes indicate how the request was received
15 * and some details about its processing pathway.
17 * see also http://wiki.squid-cache.org/SquidFaq/SquidLogs#Squid_result_codes
18 * for details on particular components.
24 LOG_TCP_REFRESH_UNMODIFIED
, // refresh from origin revalidated existing entry
25 LOG_TCP_REFRESH_FAIL_OLD
, // refresh from origin failed, stale reply sent
26 LOG_TCP_REFRESH_FAIL_ERR
, // refresh from origin failed, error forwarded
27 LOG_TCP_REFRESH_MODIFIED
, // refresh from origin replaced existing entry
28 LOG_TCP_REFRESH
, // refresh from origin started, but still pending
29 LOG_TCP_CLIENT_REFRESH_MISS
,
32 LOG_TCP_SWAPFAIL_MISS
,
39 LOG_TCP_TUNNEL
, // a binary tunnel was established for this transaction
52 LogTags(LogTags_ot t
) : oldType(t
) {assert(oldType
< LOG_TYPE_MAX
);}
53 // XXX: this operator does not reset flags
54 // TODO: either replace with a category-only setter or remove
55 LogTags
&operator =(const LogTags_ot
&t
) {assert(t
< LOG_TYPE_MAX
); oldType
= t
; return *this;}
57 /// compute the status access.log field
58 const char *c_str() const;
60 /// determine if the log tag code indicates a cache HIT
61 bool isTcpHit() const;
63 /// Things that may happen to a transaction while it is being
64 /// processed according to its LOG_* category. Logged as _SUFFIX(es).
65 /// Unlike LOG_* categories, these flags may not be mutually exclusive.
68 Errors() : ignored(false), timedout(false), aborted(false) {}
70 bool ignored
; ///< _IGNORED: the response was not used for anything
71 bool timedout
; ///< _TIMEDOUT: terminated due to a lifetime or I/O timeout
72 bool aborted
; ///< _ABORTED: other abnormal termination (e.g., I/O error)
76 /// list of string representations for LogTags_ot
77 static const char *Str_
[];
79 public: // XXX: only until client_db.cc stats are redesigned.
81 // deprecated LogTag enum value
85 /// iterator for LogTags_ot enumeration
86 inline LogTags_ot
&operator++ (LogTags_ot
&aLogType
)
88 int tmp
= (int)aLogType
;
89 aLogType
= (LogTags_ot
)(++tmp
);