Continuation handler is a function pointer, this function is to assign the continuation handler to a specific function. */
| 70 | /* Continuation handler is a function pointer, this function |
| 71 | is to assign the continuation handler to a specific function. */ |
| 72 | int |
| 73 | main_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. */ |
| 97 | TSCont |
nothing calls this directly
no test coverage detected