MCPcopy Create free account
hub / github.com/apache/trafficserver / startup

Method startup

plugins/experimental/rate_limit/sni_selector.cc:272–294  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// Startup of the SNI selector hooks and config reload continuation and instance. This should only be called once, after which the configuration continuation takes over any reloads.

Source from the content-addressed store, hash-verified

270// continuation takes over any reloads.
271//
272void
273SniSelector::startup(const std::string &yaml_file)
274{
275 auto sni_cont = TSContCreate(sni_limit_cont, nullptr);
276 auto config_cont = TSContCreate(sni_config_cont, TSMutexCreate());
277
278 TSReleaseAssert(sni_cont);
279 TSReleaseAssert(config_cont);
280
281 _instance.store(new SniSelector());
282 TSHttpHookAdd(TS_SSL_CLIENT_HELLO_HOOK, sni_cont);
283 TSHttpHookAdd(TS_VCONN_CLOSE_HOOK, sni_cont);
284
285 auto selector = SniSelector::instance(); // Assure that we don't delete this until next config reload
286
287 if (selector->yamlParser(yaml_file)) {
288 selector->setupQueueCont(); // Start the queue processing continuation if needed
289 TSMgmtUpdateRegister(config_cont, PLUGIN_NAME, yaml_file.c_str());
290 } else {
291 selector->release();
292 TSFatal("[%s] Failed to parse YAML file '%s'", PLUGIN_NAME, yaml_file.c_str());
293 }
294}

Callers

nothing calls this directly

Calls 10

TSContCreateFunction · 0.85
TSMutexCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
TSMgmtUpdateRegisterFunction · 0.85
TSFatalFunction · 0.85
yamlParserMethod · 0.80
setupQueueContMethod · 0.80
storeMethod · 0.45
c_strMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected