global plugin
| 398 | |
| 399 | ///// global plugin |
| 400 | void |
| 401 | TSPluginInit(int argc, char const *argv[]) |
| 402 | { |
| 403 | TSPluginRegistrationInfo info; |
| 404 | info.plugin_name = (char *)PLUGIN_NAME; |
| 405 | info.vendor_name = (char *)"Apache Software Foundation"; |
| 406 | info.support_email = (char *)"dev@trafficserver.apache.org"; |
| 407 | |
| 408 | if (TS_SUCCESS != TSPluginRegister(&info)) { |
| 409 | ERROR_LOG("Plugin registration failed.\n"); |
| 410 | ERROR_LOG("Unable to initialize plugin (disabled)."); |
| 411 | return; |
| 412 | } |
| 413 | |
| 414 | globalConfig.fromArgs(argc - 1, argv + 1); |
| 415 | |
| 416 | TSCont const global_read_request_contp(TSContCreate(global_read_request_hook, nullptr)); |
| 417 | global_read_resp_hdr_contp = TSContCreate(read_resp_hdr, nullptr); |
| 418 | |
| 419 | // Called immediately after the request header is read from the client |
| 420 | TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, global_read_request_contp); |
| 421 | |
| 422 | // Register stats for metadata cache |
| 423 | init_stats(globalConfig, "global"); |
| 424 | } |
nothing calls this directly
no test coverage detected