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

Function main_handler

example/plugins/c-api/protocol/TxnSM.cc:72–94  ·  view source on GitHub ↗

Continuation handler is a function pointer, this function is to assign the continuation handler to a specific function. */

Source from the content-addressed store, hash-verified

70/* Continuation handler is a function pointer, this function
71 is to assign the continuation handler to a specific function. */
72int
73main_handler(TSCont contp, TSEvent event, void *data)
74{
75 TxnSM *txn_sm = static_cast<TxnSM *>(TSContDataGet(contp));
76 TxnSMHandler q_current_handler = txn_sm->q_current_handler;
77
78 Dbg(dbg_ctl, "main_handler (contp %p event %d)", contp, event);
79
80 /* handle common cases errors */
81 if (event == TS_EVENT_ERROR) {
82 return prepare_to_die(contp);
83 }
84
85 if (q_current_handler != reinterpret_cast<TxnSMHandler>(&state_interface_with_server)) {
86 if (event == TS_EVENT_VCONN_EOS) {
87 return prepare_to_die(contp);
88 }
89 }
90
91 Dbg(dbg_ctl, "current_handler (%p)", q_current_handler);
92
93 return (*q_current_handler)(contp, event, data);
94}
95
96/* Create the Txn data structure and the continuation for the Txn. */
97TSCont

Callers

nothing calls this directly

Calls 2

TSContDataGetFunction · 0.85
prepare_to_dieFunction · 0.85

Tested by

no test coverage detected