| 62 | } |
| 63 | |
| 64 | void |
| 65 | TSPluginInit(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 | } |
nothing calls this directly
no test coverage detected