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

Function TSRemapNewInstance

plugins/compress/compress.cc:1226–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1224}
1225
1226TSReturnCode
1227TSRemapNewInstance(int argc, char *argv[], void **instance, char * /* errbuf ATS_UNUSED */, int /* errbuf_size ATS_UNUSED */)
1228{
1229 info("Instantiating a new compress plugin remap rule");
1230 info("Reading config from file = %s", argv[2]);
1231
1232 const char *config_path = nullptr;
1233
1234 if (argc > 4) {
1235 fatal("The compress plugin does not accept more than one plugin argument");
1236 } else {
1237 config_path = TSstrdup(3 == argc ? argv[2] : "");
1238 }
1239 if (!global_hidden_header_name) {
1240 global_hidden_header_name = init_hidden_header_name();
1241 }
1242
1243 Configuration *config = Configuration::Parse(config_path);
1244 *instance = config;
1245
1246 free((void *)config_path);
1247 info("Configuration loaded");
1248 return TS_SUCCESS;
1249}
1250
1251void
1252TSRemapDeleteInstance(void *instance)

Callers

nothing calls this directly

Calls 2

TSstrdupFunction · 0.85
init_hidden_header_nameFunction · 0.85

Tested by

no test coverage detected