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

Function handle_io

modules/event_stream/stream_send.c:659–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657}
658
659static int handle_io(struct fd_map *fm, int idx, int event_type)
660{
661 stream_send_t *jsonrpcs;
662 struct stream_con *con;
663
664 switch (fm->type) {
665 case F_EV_JSONRPC_CMD:
666 jsonrpcs = stream_receive();
667 if (!jsonrpcs) {
668 LM_ERR("invalid receive jsonrpc command\n");
669 return -1;
670 }
671
672 handle_new_stream(jsonrpcs);
673 break;
674 case F_EV_JSONRPC_RPL:
675 con = (struct stream_con *)fm->data;
676 if (event_type == IO_WATCH_READ)
677 handle_reply_jsonrpc(con);
678 else
679 handle_write_jsonrpc(con);
680 break;
681 default:
682 LM_CRIT("unknown fd type %d in JSON-RPC handler\n", fm->type);
683 return 0;
684 }
685 return 0;
686}
687
688static void stream_cleanup_old(void)
689{

Callers

nothing calls this directly

Calls 4

stream_receiveFunction · 0.85
handle_new_streamFunction · 0.85
handle_reply_jsonrpcFunction · 0.85
handle_write_jsonrpcFunction · 0.85

Tested by

no test coverage detected