XactionInitiator.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2025 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  {"ipc", initIpc},
31  {"adaptation", initAdaptation},
32  {"icon", initIcon},
33  {"peer-mcast", initPeerMcast},
34  {"internal", InternalInitiators()},
35  {"all", AllInitiators()}
36  };
37  const auto it = SupportedInitiators.find(name);
38  if (it != SupportedInitiators.cend())
39  return it->second;
40 
41  debugs(28, DBG_CRITICAL, "FATAL: Invalid transaction_initiator value near " << name);
42  self_destruct();
43  return 0;
44 }
45 
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
@ 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