MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / stream_cleanup_old

Function stream_cleanup_old

modules/event_stream/stream_send.c:688–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

686}
687
688static 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
712void stream_process(int rank)

Callers 1

stream_processFunction · 0.85

Calls 6

list_for_each_safeFunction · 0.85
get_time_diffFunction · 0.85
list_delFunction · 0.85
jsonrpc_cmd_freeFunction · 0.85
list_entryClass · 0.50

Tested by

no test coverage detected