Setting Up a Transaction Hook

    This code fragment shows some interesting features. The plugin is comparing the requested site to the list of listed sites. While the plugin is using the denylist, it must acquire the mutex lock for the denylist to prevent configuration changes in the middle of a denylisting operation. If the requested site is listed, then the following things happen:

    In general, whenever the plugin is doing something to a transaction, it must reenable the transaction when it is finished. In other words: every time your handler function handles a transaction event, it must call when it is finished. Similarly, after your plugin handles session events (TS_EVENT_HTTP_SSN_START and TS_EVENT_HTTP_SSN_CLOSE), it must reenable the session with TSHttpSsnReenable. Reenabling the transaction twice in the same plugin routine is a bad error.