2 * Copyright (C) 1996-2020 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.
13 // old deprecated tag strings
14 const char * LogTags::Str_
[] = {
18 "TCP_REFRESH_UNMODIFIED",
19 "TCP_REFRESH_FAIL_OLD",
20 "TCP_REFRESH_FAIL_ERR",
21 "TCP_REFRESH_MODIFIED",
23 "TCP_CLIENT_REFRESH_MISS",
44 LogTags::update(const LogTags_ot t
)
46 assert(t
< LOG_TYPE_MAX
);
47 debugs(83, 7, Str_
[oldType
] << " to " << Str_
[t
]);
52 * This method is documented in http://wiki.squid-cache.org/SquidFaq/SquidLogs#Squid_result_codes
53 * Please keep the wiki up to date
56 LogTags::c_str() const
58 static char buf
[1024];
63 const int protoLen
= 3;
64 if (oldType
&& oldType
< LOG_TYPE_MAX
) {
65 assert(Str_
[oldType
][protoLen
] == '_');
66 snprintf(buf
, protoLen
+ 1, "%s", Str_
[oldType
]);
70 pos
+= snprintf(buf
, sizeof(buf
), "NONE");
72 if (collapsingHistory
.collapsed())
73 pos
+= snprintf(buf
+ pos
, sizeof(buf
) - pos
, "_CF");
75 const char *tag
= Str_
[oldType
] + protoLen
;
76 pos
+= snprintf(buf
+ pos
, sizeof(buf
) - pos
, "%s", tag
);
79 pos
+= snprintf(buf
+pos
,sizeof(buf
)-pos
, "_IGNORED");
83 pos
+= snprintf(buf
+pos
,sizeof(buf
)-pos
, "_TIMEDOUT");
85 pos
+= snprintf(buf
+pos
,sizeof(buf
)-pos
, "_ABORTED");
91 LogTags::isTcpHit() const
94 (oldType
== LOG_TCP_HIT
) ||
95 (oldType
== LOG_TCP_IMS_HIT
) ||
96 (oldType
== LOG_TCP_INM_HIT
) ||
97 (oldType
== LOG_TCP_REFRESH_FAIL_OLD
) ||
98 (oldType
== LOG_TCP_REFRESH_UNMODIFIED
) ||
99 (oldType
== LOG_TCP_NEGATIVE_HIT
) ||
100 (oldType
== LOG_TCP_MEM_HIT
) ||
101 (oldType
== LOG_TCP_OFFLINE_HIT
);