Called by ATS as our initialization point
| 91 | |
| 92 | // Called by ATS as our initialization point |
| 93 | void |
| 94 | TSPluginInit(int /* argc ATS_UNUSED */, const char ** /* argv ATS_UNUSED */) |
| 95 | { |
| 96 | bool success = false; |
| 97 | TSPluginRegistrationInfo info; |
| 98 | TSCont cb_cert = nullptr; // Certificate callback continuation |
| 99 | |
| 100 | info.plugin_name = PLUGIN_NAME; |
| 101 | info.vendor_name = "Apache Software Foundation"; |
| 102 | info.support_email = "dev@trafficserver.apache.org"; |
| 103 | |
| 104 | if (TS_SUCCESS != TSPluginRegister(&info)) { |
| 105 | TSError(PCP "registration failed"); |
| 106 | } else if (TSTrafficServerVersionGetMajor() < 2) { |
| 107 | TSError(PCP "requires Traffic Server 2.0 or later"); |
| 108 | } else if (nullptr == (cb_cert = TSContCreate(&CB_servername, TSMutexCreate()))) { |
| 109 | TSError(PCP "Failed to create cert callback"); |
| 110 | } else { |
| 111 | TSHttpHookAdd(TS_SSL_CERT_HOOK, cb_cert); |
| 112 | success = true; |
| 113 | } |
| 114 | |
| 115 | if (!success) { |
| 116 | TSError(PCP "not initialized"); |
| 117 | } |
| 118 | Dbg(dbg_ctl, "Plugin %s", success ? "online" : "offline"); |
| 119 | |
| 120 | return; |
| 121 | } |
nothing calls this directly
no test coverage detected