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

Function TSPluginInit

example/plugins/c-api/disable_http2/disable_http2.cc:64–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void
65TSPluginInit(int argc, char const *argv[])
66{
67 int ret;
68 TSPluginRegistrationInfo info;
69
70 info.plugin_name = PLUGIN_NAME;
71 info.vendor_name = "Apache Software Foundation";
72 info.support_email = "dev@trafficserver.apache.org";
73 ret = TSPluginRegister(&info);
74
75 if (ret != TS_SUCCESS) {
76 TSError("[%s] registration failed", PLUGIN_NAME);
77 return;
78 } else if (argc < 2) {
79 TSError("[%s] Usage %s.so servername1 servername2 ... ", PLUGIN_NAME, PLUGIN_NAME);
80 return;
81 } else {
82 Dbg(dbg_ctl, "registration succeeded");
83 }
84
85 for (int i = 1; i < argc; i++) {
86 Dbg(dbg_ctl, "%s added to the No-H2 list", argv[i]);
87 Domains.emplace(std::string(argv[i], strlen(argv[i])));
88 }
89 // These callbacks do not modify any state so no lock is needed.
90 TSCont cb_sni = TSContCreate(&CB_SNI, nullptr);
91
92 TSHttpHookAdd(TS_SSL_SERVERNAME_HOOK, cb_sni);
93}

Callers

nothing calls this directly

Calls 6

TSPluginRegisterFunction · 0.85
stringClass · 0.85
TSContCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
emplaceMethod · 0.80
TSErrorFunction · 0.50

Tested by

no test coverage detected