LogTags.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 #ifndef SQUID_SRC_LOGTAGS_H
10 #define SQUID_SRC_LOGTAGS_H
11 
12 #include "CollapsingHistory.h"
13 
22 typedef enum {
26  LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
27  LOG_TCP_REFRESH_FAIL_OLD, // refresh from origin failed, stale reply sent
28  LOG_TCP_REFRESH_FAIL_ERR, // refresh from origin failed, error forwarded
29  LOG_TCP_REFRESH_MODIFIED, // refresh from origin replaced existing entry
30  LOG_TCP_REFRESH, // refresh from origin started, but still pending
41  LOG_TCP_TUNNEL, // a binary tunnel was established for this transaction
49 } LogTags_ot;
50 
51 class LogTags
52 {
53 public:
54  LogTags() = default;
55  explicit LogTags(const LogTags_ot t) { update(t); }
56 
57  void update(const LogTags_ot t);
58 
60  const char *c_str() const;
61 
63  bool isTcpHit() const;
64 
68  class Errors {
69  public:
71 
72  bool ignored;
73  bool timedout;
74  bool aborted;
75  } err;
76 
77 private:
79  static const char *Str_[];
80 
81 public: // XXX: only until client_db.cc stats are redesigned.
82 
87 };
88 
90 inline LogTags_ot &operator++ (LogTags_ot &aLogType)
91 {
92  int tmp = (int)aLogType;
93  aLogType = (LogTags_ot)(++tmp);
94  return aLogType;
95 }
96 
97 #endif
98 
CollapsingHistory collapsingHistory
controls CF tag presence
Definition: LogTags.h:86
bool timedout
_TIMEDOUT: terminated due to a lifetime or I/O timeout
Definition: LogTags.h:73
bool isTcpHit() const
determine if the log tag code indicates a cache HIT
Definition: LogTags.cc:91
bool ignored
_IGNORED: the response was not used for anything
Definition: LogTags.h:72
LogTags(const LogTags_ot t)
Definition: LogTags.h:55
const char * c_str() const
compute the status access.log field
Definition: LogTags.cc:56
collapsed forwarding history of a master transaction
LogTags_ot
Definition: LogTags.h:22
LogTags_ot & operator++(LogTags_ot &aLogType)
iterator for LogTags_ot enumeration
Definition: LogTags.h:90
void update(const LogTags_ot t)
Definition: LogTags.cc:44
LogTags()=default
bool SIGHDLR int STUB void int
Definition: stub_tools.cc:68
LogTags_ot oldType
a set of client protocol, cache use, and other transaction outcome tags
Definition: LogTags.h:84
class LogTags::Errors err
static const char * Str_[]
list of string representations for LogTags_ot
Definition: LogTags.h:79
bool aborted
_ABORTED: other abnormal termination (e.g., I/O error)
Definition: LogTags.h:74
#define false
Definition: GnuRegex.c:233

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors