| 754 | |
| 755 | |
| 756 | inline 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 |
no test coverage detected