🐞 fix: 调整TFE conf 文件, 使用四元组分流; 调整metric接口调用位置
This commit is contained in:
@@ -52,20 +52,20 @@ struct tfe_cmsg* tfe_cmsg_init()
|
||||
return cmsg;
|
||||
}
|
||||
|
||||
void tfe_cmsg_destroy(struct tfe_cmsg *cmsg)
|
||||
void tfe_cmsg_destroy(struct tfe_cmsg **cmsg)
|
||||
{
|
||||
if(cmsg != NULL)
|
||||
if(*cmsg != NULL)
|
||||
{
|
||||
if ((__sync_sub_and_fetch(&cmsg->ref, 1) != 0))
|
||||
if ((__sync_sub_and_fetch(&((*cmsg)->ref), 1) != 0))
|
||||
return;
|
||||
pthread_rwlock_wrlock(&cmsg->rwlock);
|
||||
pthread_rwlock_wrlock(&((*cmsg)->rwlock));
|
||||
for(int i = 0; i < TFE_CMSG_TLV_NR_MAX; i++)
|
||||
{
|
||||
FREE(&(cmsg->tlvs[i]));
|
||||
FREE(&((*cmsg)->tlvs[i]));
|
||||
}
|
||||
pthread_rwlock_unlock(&cmsg->rwlock);
|
||||
pthread_rwlock_destroy(&cmsg->rwlock);
|
||||
FREE(&cmsg);
|
||||
pthread_rwlock_unlock(&((*cmsg)->rwlock));
|
||||
pthread_rwlock_destroy(&((*cmsg)->rwlock));
|
||||
FREE(cmsg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,6 +296,6 @@ int tfe_cmsg_deserialize(const unsigned char *data, uint16_t len, struct tfe_cms
|
||||
return 0;
|
||||
|
||||
error_out:
|
||||
tfe_cmsg_destroy(cmsg);
|
||||
tfe_cmsg_destroy(&cmsg);
|
||||
return TFE_CMSG_INVALID_FORMAT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user