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

Function TSPluginInit

example/plugins/c-api/request_buffer/request_buffer.cc:128–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void
129TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
130{
131 TSPluginRegistrationInfo info;
132
133 info.plugin_name = PLUGIN_NAME;
134 info.vendor_name = "Apache Software Foundation";
135 info.support_email = "dev@trafficserver.apache.org";
136
137 if (TSPluginRegister(&info) != TS_SUCCESS) {
138 Dbg(dbg_ctl, "[%s] Plugin registration failed, plugin disabled", PLUGIN_NAME);
139
140 return;
141 }
142
143 /* This is call we could use if we need to protect global data */
144 /* TSReleaseAssert ((mutex = TSMutexCreate()) != TS_NULL_MUTEX); */
145
146 TSMutex mutex = TS_NULL_MUTEX;
147 TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, TSContCreate(global_plugin, mutex));
148 Dbg(dbg_ctl, "[%s] Plugin registration succeeded", PLUGIN_NAME);
149}

Callers

nothing calls this directly

Calls 3

TSPluginRegisterFunction · 0.85
TSHttpHookAddFunction · 0.85
TSContCreateFunction · 0.85

Tested by

no test coverage detected