| 686 | } |
| 687 | |
| 688 | static void stream_cleanup_old(void) |
| 689 | { |
| 690 | struct list_head *it_con, *it_cmd, *tmp; |
| 691 | struct jsonrpc_cmd *cmd; |
| 692 | struct stream_con *con; |
| 693 | |
| 694 | /* goes through each command and times it out */ |
| 695 | list_for_each(it_con, &stream_conns) { |
| 696 | con = list_entry(it_con, struct stream_con, list); |
| 697 | list_for_each_safe(it_cmd, tmp, &con->cmds) { |
| 698 | cmd = list_entry(it_cmd, struct jsonrpc_cmd, list); |
| 699 | if (get_time_diff(&cmd->job->time) > stream_timeout * 1000) { |
| 700 | if (cmd->job->async_ctx.status_cb) |
| 701 | stream_dispatch_status_cb(&cmd->job->async_ctx, EVI_STATUS_FAIL); |
| 702 | list_del(&cmd->list); |
| 703 | LM_INFO("Handling JSON-RPC command [%.*s] timed out!\n", |
| 704 | cmd->job->message.len, cmd->job->message.s); |
| 705 | jsonrpc_cmd_free(cmd); |
| 706 | } |
| 707 | } |
| 708 | } |
| 709 | } |
| 710 | |
| 711 | |
| 712 | void stream_process(int rank) |
no test coverage detected