sudheerv commented on a change in pull request #6800:
URL: https://github.com/apache/trafficserver/pull/6800#discussion_r427564290
##########
File path: include/tscpp/api/Plugin.h
##########
@@ -58,6 +58,7 @@ class Plugin : noncopyable
HOOK_READ_REQUEST_HEADERS, /**< This hook will be fired after the request
is read. */
HOOK_READ_CACHE_HEADERS, /**< This hook will be fired after the CACHE
hdrs. */
HOOK_CACHE_LOOKUP_COMPLETE, /**< This hook will be fired after cache
lookup complete. */
+ HOOK_TXN_CLOSE, /**< This hook will be fired after send
response headers. */
Review comment:
Ack. Makes sense.
##########
File path: src/tscpp/api/utils_internal.cc
##########
@@ -49,6 +49,25 @@ resetTransactionHandles(Transaction &transaction, TSEvent
event)
return;
}
+void
+cleanupTransaction(Transaction &transaction, TSHttpTxn ats_txn_handle)
+{
+ delete &transaction;
+ // reset the txn arg to prevent use-after-free
+ TSUserArgSet(ats_txn_handle, TRANSACTION_STORAGE_INDEX, nullptr);
+}
+
+void
+cleanupTransactionPlugin(Plugin *plugin)
+{
+ TransactionPlugin *transaction_plugin = static_cast<TransactionPlugin
*>(plugin);
Review comment:
Ack.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]