MCPcopy Create free account
hub / github.com/apache/trafficserver / TSPluginInit

Function TSPluginInit

tests/tools/plugins/hook_tunnel_plugin.cc:78–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void
79TSPluginInit(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}

Callers

nothing calls this directly

Calls 7

TSPluginRegisterFunction · 0.85
TSStatCreateFunction · 0.85
TSContCreateFunction · 0.85
TSMutexCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
TSLifecycleHookAddFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected