XactionInitiator.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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 #include "squid.h"
10 #include "cache_cf.h"
11 #include "debug/Stream.h"
12 #include "XactionInitiator.h"
13 
14 #include <map>
15 #include <string>
16 
19 {
20  typedef std::map<std::string, XactionInitiator::Initiators> InitiatorsMap;
21  static InitiatorsMap SupportedInitiators = {
22  {"client", initClient},
23  {"peer-pool", initPeerPool},
24  {"certificate-fetching", initCertFetcher},
25  {"cache-digest", initCacheDigest},
26  {"server", initServer},
27  {"htcp", initHtcp},
28  {"icp", initIcp},
29  {"icmp", initIcmp},
30  {"asn", initAsn},
31  {"ipc", initIpc},
32  {"adaptation", initAdaptation},
33  {"icon", initIcon},
34  {"peer-mcast", initPeerMcast},
35  {"internal", InternalInitiators()},
36  {"all", AllInitiators()}
37  };
38  const auto it = SupportedInitiators.find(name);
39  if (it != SupportedInitiators.cend())
40  return it->second;
41 
42  debugs(28, DBG_CRITICAL, "FATAL: Invalid transaction_initiator value near " << name);
43  self_destruct();
44  return 0;
45 }
46 
static Initiators AllInitiators()
all initiators
@ initClient
HTTP or FTP client.
#define DBG_CRITICAL
Definition: Stream.h:37
@ initCertFetcher
Missing intermediate certificates fetching code.
@ initPeerMcast
neighbor multicast
static Initiators InternalInitiators()
internally generated requests
@ initServer
HTTP/2 push request (not yet supported by Squid)
@ initPeerPool
PeerPool manager.
uint32_t Initiators
Initiator set.
@ initIcon
internal icons
@ initIpc
the IPC subsystem
void self_destruct(void)
Definition: cache_cf.cc:276
@ initAsn
the ASN db subsystem
@ initHtcp
HTCP client.
@ initCacheDigest
Cache Digest fetching code.
@ initIcmp
the ICMP RTT database (NetDB) neighbors exchange subsystem
static Initiators ParseInitiators(const char *name)
@ initAdaptation
ICAP/ECAP requests generated by Squid.
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:192
@ initIcp
the ICP/neighbors subsystem

 

Introduction

Documentation

Support

Miscellaneous