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

Function TSRemapNewInstance

tests/tools/plugins/user_args.cc:140–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140TSReturnCode
141TSRemapNewInstance(int /* argc ATS_UNUSED */, char ** /* argv ATS_UNUSED */, void **ih, char * /* errbuf ATS_UNUSED */,
142 int /* errbuf_size ATS_UNUSED */)
143{
144 ArgIndexes *ix = new ArgIndexes;
145
146 ix->contp = TSContCreate(cont_remap, nullptr);
147 TSContDataSet(ix->contp, static_cast<void *>(ix));
148
149 if (TS_SUCCESS != TSUserArgIndexNameLookup(TS_USER_ARGS_TXN, PLUGIN_NAME, &ix->TXN, nullptr)) {
150 TSError("[%s] Failed to lookup TXN arg.", PLUGIN_NAME);
151 return TS_ERROR;
152 } else if (TS_SUCCESS != TSUserArgIndexNameLookup(TS_USER_ARGS_SSN, PLUGIN_NAME, &ix->SSN, nullptr)) {
153 TSError("[%s] Failed to lookup SSN arg.", PLUGIN_NAME);
154 return TS_ERROR;
155 } else if (TS_SUCCESS != TSUserArgIndexNameLookup(TS_USER_ARGS_VCONN, PLUGIN_NAME, &ix->VCONN, nullptr)) {
156 TSError("[%s] Failed to lookup VCONN arg.", PLUGIN_NAME);
157 return TS_ERROR;
158 } else if (TS_SUCCESS != TSUserArgIndexNameLookup(TS_USER_ARGS_GLB, PLUGIN_NAME, &ix->GLB, nullptr)) {
159 TSError("[%s] Failed to lookup GLB arg.", PLUGIN_NAME);
160 return TS_ERROR;
161 }
162
163 *ih = static_cast<void *>(ix);
164 return TS_SUCCESS;
165}
166
167void
168TSRemapDeleteInstance(void *ih)

Callers

nothing calls this directly

Calls 4

TSContCreateFunction · 0.85
TSContDataSetFunction · 0.85
TSUserArgIndexNameLookupFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected