| 113 | } |
| 114 | |
| 115 | void |
| 116 | setupTransactionManagement() |
| 117 | { |
| 118 | // Reserve a transaction slot |
| 119 | TSAssert(TS_SUCCESS == TSUserArgIndexReserve(TS_USER_ARGS_TXN, "atscppapi", "ATS CPP API", &TRANSACTION_STORAGE_INDEX)); |
| 120 | // We must always have a cleanup handler available |
| 121 | TSMutex mutex = nullptr; |
| 122 | TSCont cont = TSContCreate(handleTransactionEvents, mutex); |
| 123 | TSHttpHookAdd(TS_HTTP_POST_REMAP_HOOK, cont); |
| 124 | TSHttpHookAdd(TS_HTTP_SEND_REQUEST_HDR_HOOK, cont); |
| 125 | TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, cont); |
| 126 | TSHttpHookAdd(TS_HTTP_SEND_RESPONSE_HDR_HOOK, cont); |
| 127 | TSHttpHookAdd(TS_HTTP_READ_CACHE_HDR_HOOK, cont); |
| 128 | TSHttpHookAdd(TS_HTTP_TXN_CLOSE_HOOK, cont); |
| 129 | } |
| 130 | |
| 131 | void inline invokePluginForEvent(Plugin *plugin, TSHttpTxn ats_txn_handle, TSEvent event) |
| 132 | { |
nothing calls this directly
no test coverage detected