| 129 | } |
| 130 | |
| 131 | void inline invokePluginForEvent(Plugin *plugin, TSHttpTxn ats_txn_handle, TSEvent event) |
| 132 | { |
| 133 | Transaction &transaction = utils::internal::getTransaction(ats_txn_handle); |
| 134 | switch (event) { |
| 135 | case TS_EVENT_HTTP_PRE_REMAP: |
| 136 | plugin->handleReadRequestHeadersPreRemap(transaction); |
| 137 | break; |
| 138 | case TS_EVENT_HTTP_POST_REMAP: |
| 139 | plugin->handleReadRequestHeadersPostRemap(transaction); |
| 140 | break; |
| 141 | case TS_EVENT_HTTP_SEND_REQUEST_HDR: |
| 142 | plugin->handleSendRequestHeaders(transaction); |
| 143 | break; |
| 144 | case TS_EVENT_HTTP_READ_RESPONSE_HDR: |
| 145 | plugin->handleReadResponseHeaders(transaction); |
| 146 | break; |
| 147 | case TS_EVENT_HTTP_SEND_RESPONSE_HDR: |
| 148 | plugin->handleSendResponseHeaders(transaction); |
| 149 | break; |
| 150 | case TS_EVENT_HTTP_OS_DNS: |
| 151 | plugin->handleOsDns(transaction); |
| 152 | break; |
| 153 | case TS_EVENT_HTTP_READ_REQUEST_HDR: |
| 154 | plugin->handleReadRequestHeaders(transaction); |
| 155 | break; |
| 156 | case TS_EVENT_HTTP_READ_CACHE_HDR: |
| 157 | plugin->handleReadCacheHeaders(transaction); |
| 158 | break; |
| 159 | case TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE: |
| 160 | plugin->handleReadCacheLookupComplete(transaction); |
| 161 | break; |
| 162 | case TS_EVENT_HTTP_TXN_CLOSE: |
| 163 | if (plugin) { |
| 164 | plugin->handleTxnClose(transaction); |
| 165 | cleanupTransactionPlugin(plugin, ats_txn_handle); |
| 166 | } else { |
| 167 | LOG_ERROR("stray event TS_EVENT_HTTP_TXN_CLOSE, no transaction plugin to handle it!"); |
| 168 | } |
| 169 | cleanupTransaction(transaction, ats_txn_handle); |
| 170 | break; |
| 171 | default: |
| 172 | assert(false); /* we should never get here */ |
| 173 | break; |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | } /* anonymous namespace */ |
| 178 |
no test coverage detected