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

Function TSPluginInit

plugins/compress/compress.cc:1179–1213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1177}
1178
1179void
1180TSPluginInit(int argc, const char *argv[])
1181{
1182 const char *config_path = nullptr;
1183 compress_config_mutex = TSMutexCreate();
1184
1185 if (argc > 2) {
1186 fatal("the compress plugin does not accept more than 1 plugin argument");
1187 } else {
1188 config_path = TSstrdup(2 == argc ? argv[1] : "");
1189 }
1190
1191 if (!register_plugin()) {
1192 fatal("the compress plugin failed to register");
1193 }
1194
1195 info("TSPluginInit %s", argv[0]);
1196
1197 if (!global_hidden_header_name) {
1198 global_hidden_header_name = init_hidden_header_name();
1199 }
1200
1201 TSCont management_contp = TSContCreate(management_update, nullptr);
1202
1203 // Make sure the global configuration is properly loaded and reloaded on changes
1204 TSContDataSet(management_contp, (void *)config_path);
1205 TSMgmtUpdateRegister(management_contp, TAG);
1206 load_global_configuration(management_contp);
1207
1208 // Setup the global hook, main entry point for kicking off the plugin
1209 TSCont transform_global_contp = TSContCreate(transform_global_plugin, nullptr);
1210
1211 TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, transform_global_contp);
1212 info("loaded");
1213}
1214
1215//////////////////////////////////////////////////////////////////////////////
1216// Initialize the plugin as a remap plugin.

Callers

nothing calls this directly

Calls 9

TSMutexCreateFunction · 0.85
TSstrdupFunction · 0.85
init_hidden_header_nameFunction · 0.85
TSContCreateFunction · 0.85
TSContDataSetFunction · 0.85
TSMgmtUpdateRegisterFunction · 0.85
TSHttpHookAddFunction · 0.85
register_pluginFunction · 0.70

Tested by

no test coverage detected