| 138 | } |
| 139 | |
| 140 | TSReturnCode |
| 141 | TSRemapNewInstance(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 | |
| 167 | void |
| 168 | TSRemapDeleteInstance(void *ih) |
nothing calls this directly
no test coverage detected