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

Function TSPluginInit

plugins/cachekey/plugin.cc:98–123  ·  view source on GitHub ↗

* @brief Global plugin instance initialization. * * Processes the configuration and initializes a global plugin instance. * @param argc plugin arguments number * @param argv plugin arguments */

Source from the content-addressed store, hash-verified

96 * @param argv plugin arguments
97 */
98void
99TSPluginInit(int argc, const char *argv[])
100{
101 TSPluginRegistrationInfo info;
102
103 info.plugin_name = PLUGIN_NAME;
104 info.vendor_name = "Apache Software Foundation";
105 info.support_email = "dev@trafficserver.apache.org";
106
107 if (TSPluginRegister(&info) != TS_SUCCESS) {
108 CacheKeyError("global plugin registration failed");
109 }
110
111 globalConfig = new Configs();
112 if (nullptr != globalConfig && globalConfig->init(argc, argv, /* perRemapConfig */ false)) {
113 TSCont cont = TSContCreate(contSetCachekey, nullptr);
114 TSHttpHookAdd(TS_HTTP_POST_REMAP_HOOK, cont);
115
116 CacheKeyDebug("global plugin initialized");
117 } else {
118 globalConfig = nullptr;
119 delete globalConfig;
120
121 CacheKeyError("failed to initialize global plugin");
122 }
123}
124
125/**
126 * @brief Plugin initialization.

Callers

nothing calls this directly

Calls 4

TSPluginRegisterFunction · 0.85
TSContCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected