| 76 | } |
| 77 | |
| 78 | void |
| 79 | TSPluginInit(int /* argc ATS_UNUSED */, const char ** /* argv ATS_UNUSED */) |
| 80 | { |
| 81 | TSPluginRegistrationInfo info; |
| 82 | |
| 83 | info.plugin_name = const_cast<char *>(PLUGIN_NAME); |
| 84 | info.support_email = const_cast<char *>("shinrich@apache.org"); |
| 85 | info.vendor_name = const_cast<char *>("Apache"); |
| 86 | |
| 87 | if (TSPluginRegister(&info) != TS_SUCCESS) { |
| 88 | TSError("[" PLUGIN_NAME "] plugin registration failed\n"); |
| 89 | return; |
| 90 | } |
| 91 | stat_tunnel_start = TSStatCreate("txn_type_verify.tunnel.start", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 92 | stat_http_req = TSStatCreate("txn_type_verify.http.req", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 93 | stat_error = TSStatCreate("txn_type_verify.error", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 94 | stat_test_done = TSStatCreate("txn_type_verify.test.done", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 95 | |
| 96 | TSCont start_tunnel_contp = TSContCreate(tunnelStart, TSMutexCreate()); |
| 97 | TSCont start_txn_contp = TSContCreate(transactionStart, TSMutexCreate()); |
| 98 | TSCont msg_contp = TSContCreate(handleMsg, TSMutexCreate()); |
| 99 | |
| 100 | TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, start_txn_contp); |
| 101 | TSHttpHookAdd(TS_HTTP_TUNNEL_START_HOOK, start_tunnel_contp); |
| 102 | TSLifecycleHookAdd(TS_LIFECYCLE_MSG_HOOK, msg_contp); |
| 103 | return; |
| 104 | } |
nothing calls this directly
no test coverage detected