| 172 | } |
| 173 | |
| 174 | Errata |
| 175 | TxnBoxInit() |
| 176 | { |
| 177 | TSPluginRegistrationInfo info{Config::PLUGIN_TAG.data(), "Verizon Media", "solidwallofcode@verizonmedia.com"}; |
| 178 | |
| 179 | Plugin_Config = std::make_shared<Config>(); |
| 180 | auto t0 = std::chrono::system_clock::now(); |
| 181 | auto errata = Plugin_Config->load_cli_args(Plugin_Config, G._args, 1); |
| 182 | if (!errata.is_ok()) { |
| 183 | return errata; |
| 184 | } |
| 185 | auto delta = std::chrono::system_clock::now() - t0; |
| 186 | std::string text; |
| 187 | TS_DBG("%s", swoc::bwprint(text, "{} files loaded in {} ms.", Plugin_Config->file_count(), |
| 188 | std::chrono::duration_cast<std::chrono::milliseconds>(delta).count()) |
| 189 | .c_str()); |
| 190 | |
| 191 | if (TSPluginRegister(&info) == TS_SUCCESS) { |
| 192 | TSCont cont{TSContCreate(CB_Txn_Start, nullptr)}; |
| 193 | TSHttpHookAdd(TS_HTTP_TXN_START_HOOK, cont); |
| 194 | G.reserve_txn_arg(); |
| 195 | } else { |
| 196 | errata.note(R"({}: plugin registration failed.)", Config::PLUGIN_TAG); |
| 197 | return errata; |
| 198 | } |
| 199 | return {}; |
| 200 | } |
| 201 | |
| 202 | void |
| 203 | TSPluginInit(int argc, char const *argv[]) |
no test coverage detected