MCPcopy Create free account
hub / github.com/apache/trafficserver / handleTransactionEvents

Function handleTransactionEvents

src/tscpp/api/utils_internal.cc:75–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75int
76handleTransactionEvents(TSCont cont, TSEvent event, void *edata)
77{
78 // This function is only here to clean up Transaction objects
79 TSHttpTxn ats_txn_handle = static_cast<TSHttpTxn>(edata);
80 Transaction &transaction = utils::internal::getTransaction(ats_txn_handle);
81 LOG_DEBUG("Got event %d on continuation %p for transaction (ats pointer %p, object %p)", event, cont, ats_txn_handle,
82 &transaction);
83
84 utils::internal::setTransactionEvent(transaction, event);
85 switch (event) {
86 case TS_EVENT_HTTP_POST_REMAP:
87 // This is here to force a refresh of the cached client request url
88 TSMBuffer hdr_buf;
89 TSMLoc hdr_loc;
90 (void)TSHttpTxnClientReqGet(static_cast<TSHttpTxn>(transaction.getAtsHandle()), &hdr_buf, &hdr_loc);
91 break;
92 case TS_EVENT_HTTP_SEND_REQUEST_HDR:
93 case TS_EVENT_HTTP_READ_RESPONSE_HDR:
94 case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
95 case TS_EVENT_HTTP_READ_CACHE_HDR:
96 // the buffer handles may be destroyed in the core during redirect follow
97 resetTransactionHandles(transaction, event);
98 break;
99 case TS_EVENT_HTTP_TXN_CLOSE: { // opening scope to declare plugins variable below
100 resetTransactionHandles(transaction, event);
101 const std::list<TransactionPlugin *> &plugins = utils::internal::getTransactionPlugins(transaction);
102 for (auto plugin : plugins) {
103 cleanupTransactionPlugin(plugin, ats_txn_handle);
104 }
105 cleanupTransaction(transaction, ats_txn_handle);
106 } break;
107 default:
108 assert(false); /* we should never get here */
109 break;
110 }
111 TSHttpTxnReenable(ats_txn_handle, TS_EVENT_HTTP_CONTINUE);
112 return 0;
113}
114
115void
116setupTransactionManagement()

Callers

nothing calls this directly

Calls 6

TSHttpTxnClientReqGetFunction · 0.85
resetTransactionHandlesFunction · 0.85
cleanupTransactionPluginFunction · 0.85
cleanupTransactionFunction · 0.85
TSHttpTxnReenableFunction · 0.85
getAtsHandleMethod · 0.80

Tested by

no test coverage detected