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

Function apply_socket_commands

modules/freeswitch/fs_proc.c:591–627  ·  view source on GitHub ↗

* - reconnects any socket found in the "fs_sockets_down" list * - performs any necessary event subscribe / unsubscribe socket operations */

Source from the content-addressed store, hash-verified

589 * - performs any necessary event subscribe / unsubscribe socket operations
590 */
591static void apply_socket_commands(void)
592{
593 struct list_head *_, *__;
594 fs_evs *sock;
595 int rc;
596
597#ifdef EXTRA_DEBUG
598 LM_DBG("applying FS socket commands\n");
599#endif
600
601 lock_start_write(sockets_esl_lock);
602 list_for_each_safe(_, __, fs_sockets_esl) {
603 sock = list_entry(_, fs_evs, esl_cmd_list);
604
605 /* above connect may have failed for this socket; skip it for now */
606 if (!SHOULD_KEEP_EVS(sock) || !list_empty(&sock->reconnect_list))
607 continue;
608
609 rc = update_event_subscriptions(sock);
610 if (rc != 0) {
611 LM_ERR("%d errors while processing sock %s:%d commands\n",
612 rc, sock->host.s, sock->port);
613 continue;
614 }
615
616 list_del(&sock->esl_cmd_list);
617 INIT_LIST_HEAD(&sock->esl_cmd_list);
618 }
619 lock_stop_write(sockets_esl_lock);
620
621 /* we may also clean up some sockets */
622 lock_start_write(sockets_lock);
623 lock_start_write(sockets_down_lock);
624 handle_reconnects();
625 lock_stop_write(sockets_down_lock);
626 lock_stop_write(sockets_lock);
627}
628
629void fs_conn_mgr_loop(int proc_no)
630{

Callers 1

fs_conn_mgr_loopFunction · 0.85

Calls 7

list_for_each_safeFunction · 0.85
list_emptyFunction · 0.85
list_delFunction · 0.85
INIT_LIST_HEADFunction · 0.85
handle_reconnectsFunction · 0.85
list_entryClass · 0.50

Tested by

no test coverage detected