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

Function TSPluginInit

plugins/slice/slice.cc:400–424  ·  view source on GitHub ↗

global plugin

Source from the content-addressed store, hash-verified

398
399///// global plugin
400void
401TSPluginInit(int argc, char const *argv[])
402{
403 TSPluginRegistrationInfo info;
404 info.plugin_name = (char *)PLUGIN_NAME;
405 info.vendor_name = (char *)"Apache Software Foundation";
406 info.support_email = (char *)"dev@trafficserver.apache.org";
407
408 if (TS_SUCCESS != TSPluginRegister(&info)) {
409 ERROR_LOG("Plugin registration failed.\n");
410 ERROR_LOG("Unable to initialize plugin (disabled).");
411 return;
412 }
413
414 globalConfig.fromArgs(argc - 1, argv + 1);
415
416 TSCont const global_read_request_contp(TSContCreate(global_read_request_hook, nullptr));
417 global_read_resp_hdr_contp = TSContCreate(read_resp_hdr, nullptr);
418
419 // Called immediately after the request header is read from the client
420 TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, global_read_request_contp);
421
422 // Register stats for metadata cache
423 init_stats(globalConfig, "global");
424}

Callers

nothing calls this directly

Calls 5

TSPluginRegisterFunction · 0.85
TSContCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
fromArgsMethod · 0.80
init_statsFunction · 0.70

Tested by

no test coverage detected