支持单机同时运行音视频和图片,所以unixsocket的配置文件不能有默认值
This commit is contained in:
54
src/main.c
54
src/main.c
@@ -523,6 +523,7 @@ int read_conf_and_init(const char* filename)
|
|||||||
uint32_t hash_max_elem_num = 0;
|
uint32_t hash_max_elem_num = 0;
|
||||||
uint32_t hash_expire_time = 0;
|
uint32_t hash_expire_time = 0;
|
||||||
char table_info_filename [MAX_PATH_LEN]={0};
|
char table_info_filename [MAX_PATH_LEN]={0};
|
||||||
|
int rec_dest = 0;
|
||||||
|
|
||||||
/*main log*/
|
/*main log*/
|
||||||
memset(conf_buf,0,sizeof(conf_buf));
|
memset(conf_buf,0,sizeof(conf_buf));
|
||||||
@@ -770,28 +771,34 @@ int read_conf_and_init(const char* filename)
|
|||||||
|
|
||||||
/*unix socket : backward data send*/
|
/*unix socket : backward data send*/
|
||||||
memset(conf_buf,0,sizeof(conf_buf));
|
memset(conf_buf,0,sizeof(conf_buf));
|
||||||
MESA_load_profile_string_def(filename, "NETWORK", "UnixSocketSendSrcAddr", conf_buf, sizeof(conf_buf),"/home/mesasoft/frag_rssb/un_sender");
|
rec_dest = MESA_load_profile_string_def(filename, "NETWORK", "UnixSocketSendSrcAddr", conf_buf, sizeof(conf_buf),"/home/mesasoft/frag_rssb/un_sender");
|
||||||
for(i=0;i<g_frag_cfg.thread_num;i++)
|
if(-1!=rec_dest)
|
||||||
{
|
{
|
||||||
memset(buf,0,sizeof(buf));
|
for(i=0;i<g_frag_cfg.thread_num;i++)
|
||||||
snprintf(buf,sizeof(buf),"%s_%02d",conf_buf,i);
|
|
||||||
g_frag_run.send_fd[i] = init_unix_socket(buf);
|
|
||||||
if(-1==g_frag_run.send_fd[i])
|
|
||||||
{
|
{
|
||||||
printf("[%s] init_unix_socket error.\n", FRAG_REASSEMBLY_MODULE_NAME);
|
memset(buf,0,sizeof(buf));
|
||||||
MESA_handle_runtime_log(g_frag_run.logger,RLOG_LV_FATAL,FRAG_REASSEMBLY_MODULE_NAME,
|
snprintf(buf,sizeof(buf),"%s_%02d",conf_buf,i);
|
||||||
(char*)"[%s:%d] init_unix_socket error." , __FILE__,__LINE__);
|
g_frag_run.send_fd[i] = init_unix_socket(buf);
|
||||||
return -1;
|
if(-1==g_frag_run.send_fd[i])
|
||||||
|
{
|
||||||
|
printf("[%s] init_unix_socket error.\n", FRAG_REASSEMBLY_MODULE_NAME);
|
||||||
|
MESA_handle_runtime_log(g_frag_run.logger,RLOG_LV_FATAL,FRAG_REASSEMBLY_MODULE_NAME,
|
||||||
|
(char*)"[%s:%d] init_unix_socket error." , __FILE__,__LINE__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memset(conf_buf,0,sizeof(conf_buf));
|
memset(conf_buf,0,sizeof(conf_buf));
|
||||||
memset(split_buf,0,sizeof(split_buf));
|
memset(split_buf,0,sizeof(split_buf));
|
||||||
MESA_load_profile_string_def(filename, "NETWORK", "UnixSocketSendDestAddr", conf_buf, sizeof(conf_buf),"");
|
rec_dest = MESA_load_profile_string_def(filename, "NETWORK", "UnixSocketSendDestAddr", conf_buf, sizeof(conf_buf),"");
|
||||||
g_frag_cfg.send_dest_addr_num = string_split(conf_buf, split_buf, DEST_MAXNUM, ';');
|
if(-1!=rec_dest)
|
||||||
for(i=0;i<(uint32_t)g_frag_cfg.send_dest_addr_num;i++)
|
|
||||||
{
|
{
|
||||||
strcpy(g_frag_cfg.send_dest_addr[i].sun_path,split_buf[i]);
|
g_frag_cfg.send_dest_addr_num = string_split(conf_buf, split_buf, DEST_MAXNUM, ';');
|
||||||
g_frag_cfg.send_dest_addr[i].sun_family = AF_UNIX;
|
for(i=0;i<(uint32_t)g_frag_cfg.send_dest_addr_num;i++)
|
||||||
|
{
|
||||||
|
strcpy(g_frag_cfg.send_dest_addr[i].sun_path,split_buf[i]);
|
||||||
|
g_frag_cfg.send_dest_addr[i].sun_family = AF_UNIX;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----USM send read conf and init----*/
|
/*----USM send read conf and init----*/
|
||||||
@@ -839,14 +846,17 @@ int read_conf_and_init(const char* filename)
|
|||||||
|
|
||||||
/*unix socket : response msg recv*/
|
/*unix socket : response msg recv*/
|
||||||
memset(conf_buf,0,sizeof(conf_buf));
|
memset(conf_buf,0,sizeof(conf_buf));
|
||||||
MESA_load_profile_string_def(filename, "NETWORK", "UnixSocketRecvAddr", conf_buf, sizeof(conf_buf),"/home/mesasoft/frag_rssb/un_recv");
|
rec_dest = MESA_load_profile_string_def(filename, "NETWORK", "UnixSocketRecvAddr", conf_buf, sizeof(conf_buf),"/home/mesasoft/frag_rssb/un_recv");
|
||||||
g_frag_run.recv_msg_fd = init_recv_unix_socket(conf_buf);
|
if(-1!=rec_dest)
|
||||||
if(-1==g_frag_run.recv_msg_fd)
|
|
||||||
{
|
{
|
||||||
printf("[%s] init_recv_unix_socket error.\n", FRAG_REASSEMBLY_MODULE_NAME);
|
g_frag_run.recv_msg_fd = init_recv_unix_socket(conf_buf);
|
||||||
MESA_handle_runtime_log(g_frag_run.logger,RLOG_LV_FATAL,FRAG_REASSEMBLY_MODULE_NAME,
|
if(-1==g_frag_run.recv_msg_fd)
|
||||||
(char*)"[%s:%d] init_recv_unix_socket." , __FILE__,__LINE__);
|
{
|
||||||
return -1;
|
printf("[%s] init_recv_unix_socket error.\n", FRAG_REASSEMBLY_MODULE_NAME);
|
||||||
|
MESA_handle_runtime_log(g_frag_run.logger,RLOG_LV_FATAL,FRAG_REASSEMBLY_MODULE_NAME,
|
||||||
|
(char*)"[%s:%d] init_recv_unix_socket." , __FILE__,__LINE__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*msg port:<3A><>ƴװ<C6B4><D7B0><EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>Ķ˿ڣ<CBBF>ǰ<EFBFBD>˽<EFBFBD><CBBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>Ķ˿<C4B6>*/
|
/*msg port:<3A><>ƴװ<C6B4><D7B0><EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>Ķ˿ڣ<CBBF>ǰ<EFBFBD>˽<EFBFBD><CBBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>Ķ˿<C4B6>*/
|
||||||
|
|||||||
Reference in New Issue
Block a user