37 static const auto protectedFieldNamesRaw = {
53 static const Notes::Keys protectedFieldNames(std::begin(protectedFieldNamesRaw), std::end(protectedFieldNamesRaw));
54 static const auto metaHeaders =
new Notes(
"ICAP header", &protectedFieldNames);
70 for (
unsigned int i = 0; i < groups.size(); ) {
73 typedef ServiceGroup::Store::const_iterator SGSI;
74 for (SGSI it = services.begin(); it != services.end(); ++it) {
77 ServiceGroup::Store::iterator newend;
78 newend = std::remove(group->
services.begin(), group->
services.end(), service);
80 debugs(93, 5,
"adaptation service " << service <<
81 " removed from group " << group->
id);
85 if (services.empty()) {
86 removeRule(group->
id);
87 Groups::iterator newend;
99 typedef ServiceConfigs::const_iterator SCI;
101 for (SCI cfg = configs.begin(); cfg != configs.end(); ++cfg) {
102 if ((*cfg)->key == service)
111 typedef AccessRules::const_iterator ARI;
113 for (ARI it = rules.begin(); it != rules.end(); ++it) {
116 debugs(93, 5,
"removing access rules for:" <<
id);
117 AccessRules::iterator newend;
130 AllGroups().
size() <<
", services: " << serviceConfigs.size());
131 typedef ServiceConfigs::const_iterator SCI;
133 for (SCI cfg = configs.begin(); cfg != configs.end(); ++cfg)
134 removeService((*cfg)->key);
135 serviceConfigs.clear();
137 AllGroups().
size() <<
", services: " << serviceConfigs.size());
145 fatalf(
"%s:%d: malformed adaptation service configuration",
148 serviceConfigs.push_back(cfg);
159 serviceConfigs.clear();
165 typedef Services::iterator SCI;
169 bool isIcap = !isEcap;
170 const char *optConnectionEncryption =
"";
173 optConnectionEncryption =
" connection-encryption=off";
175 optConnectionEncryption =
" connection-encryption=off";
177 optConnectionEncryption =
" connection-encryption=on";
185 optConnectionEncryption);
200 typedef ServiceConfigs::const_iterator VISCI;
202 for (VISCI i = configs.begin(); i != configs.end(); ++i) {
216 debugs(93,3,
"Created " << created <<
" adaptation services");
219 serviceConfigs.clear();
224template <
class Collection>
228 typedef typename Collection::iterator CI;
229 for (CI i = collection.begin(); i != collection.end(); ++i)
232 debugs(93,2,
"Initialized " << collection.size() <<
' ' << label);
239 debugs(93,
Important(11),
"Adaptation support is " << (Enabled ?
"on" :
"off."));
278 typedef Groups::iterator GI;
309 typedef AccessRules::iterator CI;
317 onoff(0), service_failure_limit(0), oldest_service_failure(0),
318 service_revival_delay(0)
#define SQUIDSTRINGPRINT(s)
static void FinalizeEach(Collection &collection, const char *label)
const char * cfg_filename
void parse(ConfigParser &parser)
static void DumpServiceGroups(StoreEntry *, const char *)
static int send_client_ip
void removeService(const String &service)
Removes the given service from all service groups.
virtual void clear()
Removes any reference to the services from configuration.
ServiceConfigPointer findServiceConfig(const String &)
static void ParseServiceSet(void)
static void Finalize(bool enable)
static void FreeServiceGroups(void)
static int use_indirect_client
static void ParseAccess(ConfigParser &parser)
static void ParseServiceGroup(ServiceGroupPointer group)
void removeRule(const String &id)
Removes access rules of the given service or group.
static bool needHistory
HttpRequest adaptation history should recorded.
static void FreeAccess(void)
void dumpService(StoreEntry *, const char *) const
std::vector< ServiceConfigPointer > ServiceConfigs
static char * masterx_shared_name
static int service_iteration_limit
static Notes & metaHeaders()
The list of configured meta headers.
virtual ServiceConfig * newServiceConfig() const
creates service configuration object that will parse and keep cfg info
static void ParseServiceChain(void)
static void DumpAccess(StoreEntry *, const char *)
a group of services that must be used one after another
Security::PeerOptions secure
const char * vectPointStr() const
YesNoNone connectionEncryption
whether this service uses only secure connections
const char * methodStr() const
std::vector< String > Store
Store removedServices
the disabled services in the case ecap or icap is disabled
static char * NextToken()
std::vector< SBuf > Keys
unordered annotation names
bool encryptTransport
whether transport encryption (TLS/SSL) is to be used on connections to the peer
int caseCmp(char const *) const
#define debugs(SECTION, LEVEL, CONTENT)
void fatalf(const char *fmt,...)
void dump_acl_access(StoreEntry *entry, const char *name, acl_access *head)
std::vector< ServiceGroupPointer > Groups
void DetachServices()
detach all adaptation services from current configuration
std::vector< Adaptation::AccessRule * > AccessRules
ServicePointer FindService(const Service::Id &key)
AccessRule * FindRuleByGroupId(const String &groupId)
#define LOCAL_ARRAY(type, name, size)
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)