| 200 | } |
| 201 | |
| 202 | void |
| 203 | TSPluginInit(int argc, char const *argv[]) |
| 204 | { |
| 205 | for (int idx = 0; idx < argc; ++idx) { |
| 206 | G._args.emplace_back(argv[idx]); |
| 207 | } |
| 208 | std::string err_str; |
| 209 | if (!G._preload_errata.is_ok()) { |
| 210 | swoc::bwprint(err_str, "{}: startup issues.\n{}", Config::PLUGIN_NAME, G._preload_errata); |
| 211 | G._preload_errata.clear(); |
| 212 | TSError("%s", err_str.c_str()); |
| 213 | } |
| 214 | auto errata{TxnBoxInit()}; |
| 215 | if (!errata.is_ok()) { |
| 216 | swoc::bwprint(err_str, "{}: initialization failure.\n{}", Config::PLUGIN_NAME, errata); |
| 217 | TSError("%s", err_str.c_str()); |
| 218 | } |
| 219 | TSLifecycleHookAdd(TS_LIFECYCLE_MSG_HOOK, TSContCreate(&CB_TxnBoxMsg, nullptr)); |
| 220 | TSLifecycleHookAdd(TS_LIFECYCLE_SHUTDOWN_HOOK, TSContCreate(&CB_TxnBoxShutdown, nullptr)); |
| 221 | #if TS_VERSION_MAJOR >= 9 |
| 222 | TSPluginDSOReloadEnable(false); |
| 223 | #endif |
| 224 | }; |
| 225 | /* ------------------------------------------------------------------------ */ |
nothing calls this directly
no test coverage detected