////////////////////////////////////////////////////////////////////////// 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.
| 270 | // continuation takes over any reloads. |
| 271 | // |
| 272 | void |
| 273 | SniSelector::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 | } |
nothing calls this directly
no test coverage detected