| 51 | static int stat_test_done = 0; // Incremented when receiving a traffic_ctl message |
| 52 | |
| 53 | static int |
| 54 | handle_msg(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */) |
| 55 | { |
| 56 | if (event == TS_EVENT_LIFECYCLE_MSG) { // External trigger, such as traffic_ctl |
| 57 | Dbg(dbg_ctl_msg, "event TS_EVENT_LIFECYCLE_MSG"); |
| 58 | // Send to a ET net thread just to be sure. |
| 59 | // Turns out the msg is sent to a task thread, but task |
| 60 | // threads do not get their thread local copy of the stats |
| 61 | // merged in. So externally, test.done was stuck at 0 without |
| 62 | // the Schedule to a NET thread |
| 63 | TSContScheduleOnPool(contp, 0, TS_THREAD_POOL_NET); |
| 64 | } else { |
| 65 | Dbg(dbg_ctl_msg, "event %d", event); |
| 66 | TSStatIntIncrement(stat_test_done, 1); |
| 67 | } |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | This function is called on every request and logs session and transaction |
nothing calls this directly
no test coverage detected