Implementing the Handler and Getting a Handle to the Transaction

The handler function for the plugin’s parent continuation is implemented as follows:

  1. static int
  2. auth_plugin (TSCont contp, TSEvent event, void *edata)
  3. {
  4. TSHttpTxn txnp = (TSHttpTxn) edata;
  5. switch (event) {
  6. case TS_EVENT_HTTP_OS_DNS:
  7. handle_dns (txnp, contp);
  8. return 0;
  9. case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
  10. handle_response (txnp);
  11. return 0;
  12. default:
  13. break;
  14. }
  15. return 0;
  16. }