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

Function TSPluginInit

plugins/experimental/cache_fill/cache_fill.cc:145–169  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////// Setup global hooks

Source from the content-addressed store, hash-verified

143///////////////////////////////////////////////////////////////////////////
144// Setup global hooks
145void
146TSPluginInit(int argc, const char *argv[])
147{
148 TSPluginRegistrationInfo info;
149
150 info.plugin_name = (char *)PLUGIN_NAME;
151 info.vendor_name = (char *)"Apache Software Foundation";
152 info.support_email = (char *)"dev@trafficserver.apache.org";
153
154 if (TS_SUCCESS != TSPluginRegister(&info)) {
155 TSError("[%s] Plugin registration failed", PLUGIN_NAME);
156 }
157
158 TSCont cont = TSContCreate(cont_handle_cache, nullptr);
159
160 gConfig = new BgFetchConfig(cont);
161
162 if (gConfig->parseOptions(argc, argv)) {
163 Dbg(dbg_ctl, "cache fill plugin is successfully initialized globally");
164 TSHttpHookAdd(TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, cont);
165 } else {
166 // ToDo: Hmmm, no way to fail a global plugin here?
167 Dbg(dbg_ctl, "Failed to initialize as global plugin");
168 }
169}
170
171///////////////////////////////////////////////////////////////////////////
172// Setup Remap mode

Callers

nothing calls this directly

Calls 5

TSPluginRegisterFunction · 0.85
TSContCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
TSErrorFunction · 0.50
parseOptionsMethod · 0.45

Tested by

no test coverage detected