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

Function TSRemapNewInstance

plugins/experimental/cache_fill/cache_fill.cc:187–221  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// We don't have any specific "instances" here, at least not yet.

Source from the content-addressed store, hash-verified

185// We don't have any specific "instances" here, at least not yet.
186//
187TSReturnCode
188TSRemapNewInstance(int argc, char **argv, void **ih, char * /* errbuf ATS_UNUSED */, int /* errbuf_size ATS_UNUSED */)
189{
190 TSCont cont = TSContCreate(cont_handle_cache, nullptr);
191 BgFetchConfig *config = new BgFetchConfig(cont);
192 bool success = true;
193
194 // The first two arguments are the "from" and "to" URL string. We need to
195 // skip them, but we also require that there be an option to masquerade as
196 // argv[0], so we increment the argument indexes by 1 rather than by 2.
197 argc--;
198 argv++;
199
200 // This is for backwards compatibility, ugly! ToDo: Remove for ATS v9.0.0 IMO.
201 if (argc > 1 && *argv[1] != '-') {
202 Dbg(dbg_ctl, "config file %s", argv[1]);
203 if (!config->readConfig(argv[1])) {
204 success = false;
205 }
206 } else {
207 if (!config->parseOptions(argc, const_cast<const char **>(argv))) {
208 success = false;
209 }
210 }
211
212 if (success) {
213 *ih = config;
214
215 return TS_SUCCESS;
216 }
217
218 // Something went wrong with the configuration setup.
219 delete config;
220 return TS_ERROR;
221}
222
223void
224TSRemapDeleteInstance(void *ih)

Callers

nothing calls this directly

Calls 3

TSContCreateFunction · 0.85
readConfigMethod · 0.45
parseOptionsMethod · 0.45

Tested by

no test coverage detected