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

Function TSRemapInit

plugins/esi/combo_handler.cc:1227–1250  ·  view source on GitHub ↗

Initialize the plugin as a remap plugin. */

Source from the content-addressed store, hash-verified

1225 Initialize the plugin as a remap plugin.
1226*/
1227TSReturnCode
1228TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
1229{
1230 if (!api_info) {
1231 strncpy(errbuf, "[TSRemapInit] - Invalid TSRemapInterface argument", errbuf_size - 1);
1232 return TS_ERROR;
1233 }
1234
1235 if (api_info->size < sizeof(TSRemapInterface)) {
1236 strncpy(errbuf, "[TSRemapInit] - Incorrect size of TSRemapInterface structure", errbuf_size - 1);
1237 return TS_ERROR;
1238 }
1239
1240 if (TSUserArgIndexReserve(TS_USER_ARGS_TXN, DEBUG_TAG, "will save plugin-enable flag here", &arg_idx) != TS_SUCCESS) {
1241 LOG_ERROR("failed to reserve private data slot");
1242 return TS_ERROR;
1243 } else {
1244 LOG_DEBUG("txn_arg_idx: %d", arg_idx);
1245 }
1246
1247 Dbg(dbg_ctl, "%s plugin's remap part is initialized", DEBUG_TAG);
1248
1249 return TS_SUCCESS;
1250}
1251
1252TSReturnCode
1253TSRemapNewInstance(int /* argc ATS_UNUSED */, char *argv[], void **ih, char * /* errbuf ATS_UNUSED */,

Callers

nothing calls this directly

Calls 1

TSUserArgIndexReserveFunction · 0.85

Tested by

no test coverage detected