////////////////////////////////////////////////////////////////////// Setup global hooks
| 143 | /////////////////////////////////////////////////////////////////////////// |
| 144 | // Setup global hooks |
| 145 | void |
| 146 | TSPluginInit(int argc, const char *argv[]) |
| 147 | { |
| 148 | TSPluginRegistrationInfo info; |
| 149 | |
| 150 | info.plugin_name = (char *)PLUGIN_NAME; |
| 151 | info.vendor_name = (char *)"Apache Software Foundation"; |
| 152 | info.support_email = (char *)"dev@trafficserver.apache.org"; |
| 153 | |
| 154 | if (TS_SUCCESS != TSPluginRegister(&info)) { |
| 155 | TSError("[%s] Plugin registration failed", PLUGIN_NAME); |
| 156 | } |
| 157 | |
| 158 | TSCont cont = TSContCreate(cont_handle_cache, nullptr); |
| 159 | |
| 160 | gConfig = new BgFetchConfig(cont); |
| 161 | |
| 162 | if (gConfig->parseOptions(argc, argv)) { |
| 163 | Dbg(dbg_ctl, "cache fill plugin is successfully initialized globally"); |
| 164 | TSHttpHookAdd(TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, cont); |
| 165 | } else { |
| 166 | // ToDo: Hmmm, no way to fail a global plugin here? |
| 167 | Dbg(dbg_ctl, "Failed to initialize as global plugin"); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | /////////////////////////////////////////////////////////////////////////// |
| 172 | // Setup Remap mode |
nothing calls this directly
no test coverage detected