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

Function TSPluginInit

example/plugins/c-api/verify_cert/verify_cert.cc:88–114  ·  view source on GitHub ↗

Called by ATS as our initialization point

Source from the content-addressed store, hash-verified

86
87// Called by ATS as our initialization point
88void
89TSPluginInit(int /* argc ATS_UNUSED */, const char ** /* argv ATS_UNUSED */)
90{
91 bool success = false;
92 TSPluginRegistrationInfo info;
93 TSCont cb_cert = nullptr; // Certificate callback continuation
94
95 info.plugin_name = PLUGIN_NAME;
96 info.vendor_name = "Apache Software Foundation";
97 info.support_email = "dev@trafficserver.apache.org";
98
99 if (TS_SUCCESS != TSPluginRegister(&info)) {
100 TSError(PCP "registration failed");
101 } else if (nullptr == (cb_cert = TSContCreate(&CB_clientcert, TSMutexCreate()))) {
102 TSError(PCP "Failed to create cert callback");
103 } else {
104 TSHttpHookAdd(TS_SSL_VERIFY_CLIENT_HOOK, cb_cert);
105 success = true;
106 }
107
108 if (!success) {
109 TSError(PCP "not initialized");
110 }
111 Dbg(dbg_ctl, "Plugin %s", success ? "online" : "offline");
112
113 return;
114}

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected