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

Function handle_io

timer.c:756–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754
755
756inline static int handle_io(struct fd_map* fm, int idx,int event_type)
757{
758 int n=0;
759
760 pt_become_active();
761
762 pre_run_handle_script_reload(fm->app_flags);
763
764 profiling_proc_start( LEVEL_SIP, 1);
765
766 switch(fm->type){
767 case F_TIMER_JOB:
768 profiling_proc_enter( LEVEL_FULL, "timer_job", 1 );
769 handle_timer_job();
770 profiling_proc_exit( LEVEL_FULL, "timer_job", n);
771 break;
772 case F_SCRIPT_ASYNC:
773 profiling_proc_enter( LEVEL_SIP, "async_script", 0 );
774 n = async_script_resume_f( fm->fd, fm->data,
775 (event_type==IO_WATCH_TIMEOUT)?1:0 );
776 profiling_proc_exit( LEVEL_SIP, "async_script", n);
777 break;
778 case F_FD_ASYNC:
779 profiling_proc_enter( LEVEL_SIP, "async_fd", 0 );
780 n = async_fd_resume( fm->fd, fm->data);
781 profiling_proc_exit( LEVEL_SIP, "async_fd", n);
782 break;
783 case F_LAUNCH_ASYNC:
784 profiling_proc_enter( LEVEL_SIP, "async_launch", 0 );
785 n = async_launch_resume( fm->fd, fm->data);
786 profiling_proc_exit( LEVEL_SIP, "async_launch", n);
787 break;
788 case F_IPC:
789 profiling_proc_enter( LEVEL_SIP, "ipc_job", 1 );
790 ipc_handle_job(fm->fd);
791 profiling_proc_exit( LEVEL_SIP, "ipc_job", n);
792 break;
793 default:
794 LM_CRIT("unknown fd type %d in Timer Extra\n", fm->type);
795 n = -1;
796 break;
797 }
798
799 if (reactor_is_empty() && _termination_in_progress==1) {
800 LM_WARN("reactor got empty while termination in progress\n");
801 ipc_handle_all_pending_jobs(IPC_FD_READ_SELF);
802 if (reactor_is_empty())
803 dynamic_process_final_exit();
804 }
805
806 profiling_proc_end( LEVEL_SIP, n );
807
808 post_run_handle_script_reload();
809
810 pt_become_idle();
811 return n;
812}
813

Callers 1

io_wait.hFile · 0.70

Calls 9

pt_become_activeFunction · 0.85
profiling_proc_startFunction · 0.85
handle_timer_jobFunction · 0.85
async_fd_resumeFunction · 0.85
async_launch_resumeFunction · 0.85
ipc_handle_jobFunction · 0.85
profiling_proc_endFunction · 0.85

Tested by

no test coverage detected