udp収流由updown 调用,示意图如下:
updown_connect(argv)----------cb-------------->udp_module_connect(argv)
发现udp_module_connect函数里面argv的参数部分是错的,gdb信息如下:
f2
p *streams_session
$23 = {signature = 0, connection = 0x0, received = 0, start_sec = 0, start_msec = 0, log_handler = 0x0, ctx = 0x0, main_conf = 0x0, srv_conf= 0x0, variables = 0x0, state = ST_TYPE_NULL, p_id = {len = 36, data = 0x165c230 "dc513cc0-cc7e-4bf2-a88a-59c409a8b2a4"}, tp = 0x13133e8, action = 0xa52560 <udp_action>, protocol_data_class = 0x165c258, lock_s = 0, blocked = 0, process_num = 0, process = 0x0, process_data = 0x0, process_lock = 0x0, process_chain = 0x0, task_alloc_queue = {prev = 0x165c158, next = 0x165c158}, audio_code = 4294967295, link_success = 0, req = 0x1667050, connecte_handler = 0x4f677a <ngx_forward_updownstream_connecte_handler>, error_handler = 0x4f6a25 <ngx_forward_updownstream_error_handler>, recv_data_handler = 0x4f9684 <ngx_forward_updownstream_recv_data_handler>, pool = 0x16, stream_flag = 0, protocol = {len = 0, data = 0x0}, unsent_chain = 0x0, shm_zone = 0x1335280, seq_no = 3739402240, priv_data_class = 0x7fffdee2c000, hassend = 0, ncaptures = 0, captures = 0x0, captures_data = 0x0, task_handle_result = 0, lock = 0, stream_count = 0, all_stream_count = 0, head_chain_mutex = 0x0, phase_handler = 0, status = 0, stat_processing = 0, health_check = 0}
f 1
p *st
$24 = {signature = 0, connection = 0x0, received = 0, start_sec = 0, start_msec = 0, log_handler = 0x0, ctx = 0x0, main_conf = 0x0, srv_conf= 0x0, variables = 0x0, state = ST_TYPE_NULL, p_id = {len = 36, data = 0x165c230 "dc513cc0-cc7e-4bf2-a88a-59c409a8b2a4"}, tp = 0x13133e8, action = 0xa52560 <udp_action>, protocol_data_class = 0x165c258, lock_s = 0, blocked = 0, process_num = 0, process = 0x0, process_data = 0x0, process_lock = 0x0, process_chain = 0x0, task_alloc_queue = {prev = 0x165c158, next = 0x165c158}, link_success = -1, req = 0x0, connecte_handler = 0x1667050, error_handler = 0x4f677a <ngx_forward_updownstream_connecte_handler>, recv_data_handler = 0x4f6a25 <ngx_forward_updownstream_error_handler>, pool = 0x4f9684 <ngx_forward_updownstream_recv_data_handler>, stream_flag = 22, protocol = {len = 0, data = 0x0}, unsent_chain = 0x0, shm_zone = 0x0, seq_no = 20140672, priv_data_class = 0x7fffdee2c000, hassend = 140736932790272, ncaptures = 0, captures = 0x0, captures_data = 0x0, task_handle_result = 0, lock = 0, stream_count = 0, all_stream_count = 0, head_chain_mutex = 0x0, phase_handler = 0, status =0, stat_processing = 0, health_check = 0}
f2的参数是调用udp模块connect函数的时候传进去的,f1是进去之后参数的内容。
这就很奇怪了,为什么进去之后f1的参数列表里面就少了一个audio_code??????
第一反应就是头文件包含的不一样吧???
反正我现在没看出来头文件有啥问题,关键是我SI直接点进去的都是一样的数据结构。
等我下周解出来答案吧。
解密答案了:
就是nginx的模块的config文件没有写好,基本原因就是ngx_streams.c文件包含了头文件,头文件改动了,但是之前make生成了ngx_streams.o文件了,
但是在config文件中
109 if :; then 110 ngx_module_name=ngx_streams_protocol_udp_module 111 ngx_module_incs= 112 ngx_module_deps= 113 ngx_module_srcs=$ngx_addon_dir/ngx_streams_module.c 114 ngx_module_libs= 115 ngx_module_link=ADDON 116 117 . auto/module 118 fi
ngx_module_deps依赖项中没有写东西,所以只要ngx_streams_module.c没有改动,make就不会重新生成这个.o文件。
两种方法解决:1、make clean之后再make
2、整理依赖项,重新编写config文件,在依赖项中填上所有依赖的头文件。