1)修复解密失败时,未关闭表文件句柄的bug;2)删除部分运行日志;

This commit is contained in:
zhengchao
2017-12-21 09:36:13 +08:00
parent 9aa6917b31
commit b360726c32
2 changed files with 7 additions and 12 deletions

View File

@@ -30,7 +30,7 @@
#include "stream_fuzzy_hash.h"
#include "gram_index_engine.h"
int MAAT_FRAME_VERSION_2_1_20171206_dev=1;
int MAAT_FRAME_VERSION_2_1_20171221_dev=1;
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
"unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""};
@@ -2056,11 +2056,7 @@ int del_region_rule(struct _Maat_table_info_t* table,int region_id,int group_id,
{
HASH_delete_by_id(maat_scanner->group_hash,group_id);
garbage_bagging(GARBAGE_GROUP_RULE, group_rule, maat_scanner->tomb_ref);
MESA_handle_runtime_log(logger,RLOG_LV_DEBUG,maat_module ,
"Indirectly delete group %d,last region rule has been delete,table %s region id %d ."
,group_id
,table->table_name[table->updating_name]
,region_id);
}
return 1;
}
@@ -2130,10 +2126,7 @@ void del_group_rule(struct _Maat_table_info_t* table,struct db_group_rule_t* db_
//Directly delete group id will not destroyp group_rule,it 'll be destroyed when delete this group's last region.
if(group_rule->ref_cnt==0&&group_rule->region_cnt==0)
{
MESA_handle_runtime_log(logger,RLOG_LV_INFO,maat_module ,
"Directly delete table %s group id %d, do this when delete its last region."
,table->table_name[table->updating_name]
,db_group_rule->group_id);
//Directly delete table %s group id %d, do this when delete its last region.
}
return;
}

View File

@@ -383,12 +383,14 @@ int cm_read_table_file(struct cm_table_info_t* index,
if(key==NULL||strlen((const char*)key)==0)
{
MESA_handle_runtime_log(logger,RLOG_LV_FATAL,module_config_monitor,"update error, no key to decrypt %s.",index->cfg_path);
fclose(fp);
return -1;
}
decrypt_len=decrypt_open(fp, key,index->encryp_algorithm, &decrypt_buff,logger);
if(decrypt_len==0)
{
MESA_handle_runtime_log(logger,RLOG_LV_FATAL,module_config_monitor,"update error, %s decrypt failed.",index->cfg_path);
fclose(fp);
return -1;
}
read_nxt_line_from_buff(decrypt_buff, decrypt_len, &decrypt_offset, line, sizeof(line));