AFAIK, there isn't a way to identify if a hook is already added, but, you can certainly block the call back being run more than once, but using either TSContDataSet() (within the same plugin) or TSHttpTxnArgSet() (across plugins).
Thanks, Sudheer On Sunday, May 8, 2016 12:08 PM, Akbar Said <xbro.aka...@gmail.com> wrote: Hi folks, Is there a way (preferably plugin visible public API) to learn if there is an event pending for some arbitrary hook given a transaction? For example, if one was to invoke: TSHttpHookAdd(TS_HTTP_TXN_CLOSE_HOOK, cont); OR TSHttpTxnHookAdd(txnp, TS_HTTP_TXN_CLOSE_HOOK, cont); is there a way to learn if there is already pending TS_EVENT_HTTP_TXN_CLOSE event for that particular transaction before or after adding a hook? Or even, when handling the event. I hope my question makes sense. I would appreciate anyone's assistance. Regards, -A