修复报告处理逻辑

This commit is contained in:
lnk
2026-07-01 14:51:55 +08:00
parent 145092b0ba
commit 405048ed44
10 changed files with 24 additions and 102 deletions

View File

@@ -457,6 +457,7 @@ typedef struct mvl_net_info
ST_VOID *user_info; /* MVL user can use this for 'whatever' */
MVL_NET_FILE *file_list; /* linked list of open files on this conn*/
ST_VOID *user_ext; /* user can use this for 'whatever', add by Lzm */
} MVL_NET_INFO;
/* Our connection control structures */

View File

@@ -197,32 +197,14 @@ void closeChannel(chnl_usr_t *chnl_usr)
ALL_RCB_INFO *all_rcb_info;
RCB_INFO *rcb_info;
ST_RET ret;
//lnk20260617防止复用崩溃
/*if(chnl_usr->net_info->user_info)
{
if(chnl_usr->net_info->user_info)
{
all_rcb_info = (ALL_RCB_INFO *)chnl_usr->net_info->user_info;
all_rcb_info = chnl_usr->all_rcb_info;
while((rcb_info = (RCB_INFO *)list_get_first(&all_rcb_info->rcb_info_list)) != NULL)
rcb_info_destroy (rcb_info);
chk_free(all_rcb_info);
chnl_usr->net_info->user_info=NULL;
}*/
if (chnl_usr->all_rcb_info)
{
all_rcb_info = chnl_usr->all_rcb_info;
while ((rcb_info = (RCB_INFO *)list_get_first(&all_rcb_info->rcb_info_list)) != NULL) {
rcb_info_destroy(rcb_info);
}
chk_free(all_rcb_info);
chnl_usr->all_rcb_info = NULL;
}
chnl_usr->net_info->user_info = NULL;
//lnk20260617防止复用崩溃
chnl_usr->net_info->rem_vmd = NULL;
echo_warn("---------start disconnectFromServer!\n");
ret = mms_disconnectFromServer(chnl_usr->net_info,&chnl_usr->m_reqCtrl);
@@ -237,10 +219,7 @@ void closeChannel(chnl_usr_t *chnl_usr)
mvl_free_req_ctrl(chnl_usr->m_reqCtrl);
//lnk20260617防止复用崩溃
chnl_usr->all_rcb_info = NULL;
chnl_usr->net_info->user_info = NULL;
chnl_usr->net_info->user_ext = NULL;
chnl_usr->net_info = NULL;
@@ -267,7 +246,7 @@ ST_VOID Callback_channel_disconnect_ind(MVL_NET_INFO * NetInfo, ST_INT discType)
{
chnl_usr_t *chnl_usr;
chnl_usr = (chnl_usr_t*)NetInfo->user_info;
chnl_usr = (chnl_usr_t*)NetInfo->user_ext;
if ( chnl_usr ) {
if(chnl_usr->m_state == CHANNEL_CONNECTING)
@@ -286,7 +265,7 @@ ST_VOID Callback_channel_disconnect_ind(MVL_NET_INFO * NetInfo, ST_INT discType)
chnl_usr->net_info = NULL;
NetInfo->user_info = NULL;
NetInfo->user_ext = NULL;
}
printf(" Callback_channel_disconnect_ind ,NetInfo = %x",NetInfo);
@@ -1741,7 +1720,7 @@ void CheckNextNotConnectedChannel()
chnl_usr->m_reqCtrl = NULL;
chnl_usr->m_state = CHANNEL_CONNECTED;
chnl_usr->net_info->user_info = chnl_usr;
chnl_usr->net_info->user_ext = chnl_usr;
all_rcb_info = (ALL_RCB_INFO *)chk_calloc(1, sizeof (ALL_RCB_INFO));
all_rcb_info->rpt_typeids = &g_rpt_typeids;
@@ -1750,9 +1729,7 @@ void CheckNextNotConnectedChannel()
echo_warn("chnl_usr->net_info->user_info is not NULL\n");
}
//lnk20260617防止复用崩溃
//chnl_usr->net_info->user_info = all_rcb_info;
chnl_usr->net_info->user_info = all_rcb_info;
chnl_usr->chnl->ied->status = STATUS_NORMAL;
chnl_usr->chnl->status = STATUS_NORMAL;
@@ -1903,7 +1880,7 @@ void CheckNextNotConnectedChannel()
echo_warn3( "CHANNEL_DISCONNECTING done %s:%d,NetInfo= %x ",chnl_usr->ip_str,chnl_usr->chnl->port,chnl_usr->net_info);
mvl_free_req_ctrl(chnl_usr->m_reqCtrl);
if(chnl_usr->net_info)
chnl_usr->net_info->user_info = NULL;
chnl_usr->net_info->user_ext = NULL;
chnl_usr->m_reqCtrl = NULL;
chnl_usr->net_info = NULL;
@@ -1931,7 +1908,7 @@ void CheckNextNotConnectedChannel()
echo_warn2( "CHANNEL_DISCONNECTING reqCtrl->done未完成,but time over 180 secs, close channel IP %s,NetInfo= %x ",chnl_usr->ip_str,chnl_usr->net_info);
mvl_free_req_ctrl(chnl_usr->m_reqCtrl);
chnl_usr->net_info->user_info = NULL;
chnl_usr->net_info->user_ext = NULL;
mms_release_connection(chnl_usr->net_info);
chnl_usr->net_info->rem_vmd = NULL;

View File

@@ -844,7 +844,7 @@ ST_VOID u_iec_rpt_ind_data_by_devtype(MVL_VAR_ASSOC** info_va,
rptinfo = find_rptinfo_from_net_rpt_info_name(net_info, rcb_info);
//rptinfo->m_LastDataTime = sGetMsTime();//WW 2023-08-29 去除
LD_info = rptinfo->LD_info;
chnl_usr = net_info->user_info;
chnl_usr = net_info->user_ext;
ied = chnl_usr->chnl->ied;
not_set_rpt_TimeID_this = TRUE;
@@ -1228,31 +1228,9 @@ ST_VOID u_iec_rpt_ind_data(MVL_VAR_ASSOC** info_va,
log_var_data(info_va[va_num], &mms_dec_data);
//assert(add_mms_dec_data== (uint32_t)&mms_dec_data);
rptinfo = find_rptinfo_from_net_rcb_info(net_info, rcb_info);
if (rptinfo == NULL) {
chnl_usr_t* chnl_usr_tmp = net_info ? (chnl_usr_t*)net_info->user_info : NULL;
printf("[RPT][ERROR] cannot find rptinfo, net_info=%p user_info=%p rcb_info=%p RptID=%s\n",
(void*)net_info,
net_info ? (void*)net_info->user_info : NULL,
(void*)rcb_info,
(rcb_info && rcb_info->RptID) ? rcb_info->RptID : "NULL");
return;
}
//rptinfo->m_LastDataTime = sGetMsTime();//WW 2023-08-29 去除
LD_info = rptinfo->LD_info;
if (LD_info == NULL) {
printf("[RPT][ERROR] rptinfo->LD_info NULL, rptinfo=%p RptID=%s\n",
(void*)rptinfo,
(rcb_info && rcb_info->RptID) ? rcb_info->RptID : "NULL");
return;
}
chnl_usr = net_info->user_info;
chnl_usr = net_info->user_ext;
ied = chnl_usr->chnl->ied;
not_set_rpt_TimeID_this = TRUE;
@@ -2031,13 +2009,7 @@ ST_RET u_iec_rpt_ind(MVL_COMM_EVENT* event)
}
/* Get "all_rcb_info" from "user_info". User must set "user_info" when conn established.*/
//lnk20260617防止复用崩溃
//all_rcb_info = (ALL_RCB_INFO*)event->net_info->user_info;
chnl_usr_t *chnl_usr = (chnl_usr_t*)event->net_info->user_info;
if (chnl_usr == NULL || chnl_usr->all_rcb_info == NULL) {
return;
}
all_rcb_info = chnl_usr->all_rcb_info;
all_rcb_info = (ALL_RCB_INFO*)event->net_info->user_info;
/* Check "all_rcb_info" to see if any RCB has been enabled. */
if (all_rcb_info == NULL || all_rcb_info->rcb_info_list == NULL)

View File

@@ -860,24 +860,8 @@ ST_UCHAR TrgOps [1]; /* 8 bit bitstring */
if(ret == SD_SUCCESS)
{
//lnk20260617防止复用崩溃
//list_add_last(&((ALL_RCB_INFO *)clientNetInfo->user_info)->rcb_info_list, rcb_info); /* add RCB to list*/
chnl_usr_t *chnl_usr = (chnl_usr_t *)clientNetInfo->user_info;
if (chnl_usr == NULL || chnl_usr->all_rcb_info == NULL) {
printf("[RPT_REGISTER][ERROR] invalid user_info=%p all_rcb_info=%p dom=%s rcb=%s\n",
clientNetInfo ? clientNetInfo->user_info : NULL,
chnl_usr ? chnl_usr->all_rcb_info : NULL,
dom_name ? dom_name : "NULL",
rcb_name ? rcb_name : "NULL");
rcb_info_destroy(rcb_info);
rcb_info = NULL;
return NULL;
}
list_add_last(&chnl_usr->all_rcb_info->rcb_info_list, rcb_info);
}
list_add_last(&((ALL_RCB_INFO *)clientNetInfo->user_info)->rcb_info_list, rcb_info); /* add RCB to list*/
}
else{
rcb_info_destroy(rcb_info);
rcb_info = NULL;

View File

@@ -375,8 +375,6 @@ struct chnl_usr_t{
double m_ClosedMsTime; //上次通道关闭时间
double m_LastPosRespTime; //上次肯定响应的时间
int m_NegRespTimes; // 累计否定响应次数
ALL_RCB_INFO *all_rcb_info;//lnk20260617防止复用崩溃
};

View File

@@ -139,7 +139,7 @@ RCB_INFO* FindRcbInfo(MVL_NET_INFO *net_info,ST_CHAR *dom_name, ST_CHAR *rcb_nam
int cpuno,rpt_no;
char rpt_inst_name[65];
chnl_usr = net_info->user_info;
chnl_usr = net_info->user_ext;
ied = chnl_usr->chnl->ied;
ied_usr = GET_IEDEXT_ADDR(ied);
@@ -188,7 +188,7 @@ rptinfo_t* find_rptinfo_from_net_rpt_info_name(MVL_NET_INFO *net_info, RCB_INFO
rptinfo_t *rptinfo = NULL;
int cpuno,rpt_no;
chnl_usr = net_info->user_info;
chnl_usr = net_info->user_ext;
ied = chnl_usr->chnl->ied;
ied_usr = GET_IEDEXT_ADDR(ied);
@@ -232,20 +232,9 @@ rptinfo_t* find_rptinfo_from_net_rcb_info(MVL_NET_INFO *net_info,RCB_INFO *rcb_i
rptinfo_t *rptinfo = NULL;
int cpuno,rpt_no;
if (net_info == NULL || rcb_info == NULL) {
return NULL;
}
chnl_usr = (chnl_usr_t*)net_info->user_info;
if (chnl_usr == NULL || chnl_usr->chnl == NULL || chnl_usr->chnl->ied == NULL) {
return NULL;
}
chnl_usr = net_info->user_ext;
ied = chnl_usr->chnl->ied;
ied_usr = GET_IEDEXT_ADDR(ied);
if (ied_usr == NULL || ied_usr->LD_info == NULL) {
return NULL;
}
for(cpuno=0 ; cpuno<ied->cpucount; cpuno++) {
LD_info = &(ied_usr->LD_info[cpuno]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -457,6 +457,7 @@ typedef struct mvl_net_info
ST_VOID *user_info; /* MVL user can use this for 'whatever' */
MVL_NET_FILE *file_list; /* linked list of open files on this conn*/
ST_VOID *user_ext; /* user can use this for 'whatever', add by Lzm */
} MVL_NET_INFO;
/* Our connection control structures */

View File

@@ -379,7 +379,7 @@ HEADERS += mmslib.h \
inc/sx_log.h \
inc/sx_defs.h \
inc/sx_arb.h \
inc/STR_UTIL.H \
inc/str_util.h \
inc/stime.h \
inc/stdtime_w32.h \
inc/stdtime_tzrules.h \
@@ -393,7 +393,7 @@ HEADERS += mmslib.h \
inc/stdtime_endian.h \
inc/stdtime_config.h \
inc/stdtime.h \
inc/ssleLog.h \
inc/sslelog.h \
inc/ssec_int.h \
inc/ssec.h \
inc/sock_log.h \
@@ -401,7 +401,7 @@ HEADERS += mmslib.h \
inc/smp_usr.h \
inc/smp_log.h \
inc/smp.h \
inc/Smem.h \
inc/smem.h \
inc/slog.h \
inc/scrndefs.h \
inc/scl.h \