void HttpSM::dump_state_on_assert Debugging routine to dump the state machine's history and other state on an assertion failure We use Diags::Status instead of stderr since Diags works both on UNIX & NT
| 7807 | // Diags works both on UNIX & NT |
| 7808 | // |
| 7809 | void |
| 7810 | HttpSM::dump_state_on_assert() |
| 7811 | { |
| 7812 | Error("[%" PRId64 "] ------- begin http state dump -------", sm_id); |
| 7813 | |
| 7814 | if (history.overflowed()) { |
| 7815 | Error(" History Wrap around. history size: %d", history.size()); |
| 7816 | } |
| 7817 | // Loop through the history and dump it |
| 7818 | for (unsigned int i = 0; i < history.size(); i++) { |
| 7819 | char buf[256]; |
| 7820 | int r = history[i].reentrancy; |
| 7821 | int e = history[i].event; |
| 7822 | Error("%d %d %s", e, r, history[i].location.str(buf, sizeof(buf))); |
| 7823 | } |
| 7824 | |
| 7825 | // Dump the via string |
| 7826 | Error("Via String: [%s]\n", t_state.via_string); |
| 7827 | |
| 7828 | // Dump header info |
| 7829 | dump_state_hdr(&t_state.hdr_info.client_request, "Client Request"); |
| 7830 | dump_state_hdr(&t_state.hdr_info.server_request, "Server Request"); |
| 7831 | dump_state_hdr(&t_state.hdr_info.server_response, "Server Response"); |
| 7832 | dump_state_hdr(&t_state.hdr_info.transform_response, "Transform Response"); |
| 7833 | dump_state_hdr(&t_state.hdr_info.client_response, "Client Response"); |
| 7834 | |
| 7835 | Error("[%" PRId64 "] ------- end http state dump ---------", sm_id); |
| 7836 | } |
| 7837 | |
| 7838 | void |
| 7839 | HttpSM::dump_state_hdr(HTTPHdr *h, const char *s) |
nothing calls this directly
no test coverage detected