HTTP transactions */
| 3844 | |
| 3845 | /* HTTP transactions */ |
| 3846 | void |
| 3847 | TSHttpTxnHookAdd(TSHttpTxn txnp, TSHttpHookID id, TSCont contp) |
| 3848 | { |
| 3849 | sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS); |
| 3850 | sdk_assert(sdk_sanity_check_continuation(contp) == TS_SUCCESS); |
| 3851 | sdk_assert(sdk_sanity_check_hook_id(id) == TS_SUCCESS); |
| 3852 | |
| 3853 | HttpSM *sm = reinterpret_cast<HttpSM *>(txnp); |
| 3854 | APIHook *hook = sm->txn_hook_get(id); |
| 3855 | |
| 3856 | // Traverse list of hooks and add a particular hook only once |
| 3857 | while (hook != nullptr) { |
| 3858 | if (hook->m_cont == reinterpret_cast<INKContInternal *>(contp)) { |
| 3859 | return; |
| 3860 | } |
| 3861 | hook = hook->m_link.next; |
| 3862 | } |
| 3863 | sm->txn_hook_add(id, reinterpret_cast<INKContInternal *>(contp)); |
| 3864 | } |
| 3865 | |
| 3866 | TSHttpSsn |
| 3867 | TSHttpTxnSsnGet(TSHttpTxn txnp) |