选项MAAT_OPT_DISABLE_UPDATE改名为MAAT_OPT_ENABLE_UPDATE
This commit is contained in:
@@ -155,7 +155,7 @@ enum MAAT_INIT_OPT
|
||||
MAAT_OPT_CUMULATIVE_UPDATE_OFF, //VALUE is NULL,SIZE is 0. Default: CUMMULATIVE UPDATE ON.
|
||||
MAAT_OPT_LOAD_VERSION_FROM, //VALUE is a long long, SIZE=sizeof(long long). Default: Load the Latest. Only valid in redis mode, and maybe failed for too old.
|
||||
//This option also disables background update.
|
||||
MAAT_OPT_DISABLE_UPDATE //VALUE is interger, SIZE=sizeof(int). 1: Enabled, 0:Disabled. DEFAULT: Backgroud update is enabled. Runtime setting is allowed.
|
||||
MAAT_OPT_ENABLE_UPDATE //VALUE is interger, SIZE=sizeof(int). 1: Enabled, 0:Disabled. DEFAULT: Backgroud update is enabled. Runtime setting is allowed.
|
||||
};
|
||||
//return -1 if failed, return 0 on success;
|
||||
int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const void* value,int size);
|
||||
|
||||
@@ -496,7 +496,7 @@ int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const vo
|
||||
int intval=0,ret=-1;
|
||||
switch(type)
|
||||
{
|
||||
case MAAT_OPT_DISABLE_UPDATE:
|
||||
case MAAT_OPT_ENABLE_UPDATE:
|
||||
intval=*((int*)value);
|
||||
if(_feather->backgroud_update_enabled!=intval)
|
||||
{
|
||||
|
||||
@@ -43,11 +43,11 @@ void Maat_read_entry_cb(int table_id,const char* table_line,void* u_para)
|
||||
{
|
||||
if(is_valid==1)
|
||||
{
|
||||
printf("Load entry id %d success.\n",entry_id);
|
||||
//printf("Load entry id %d success.\n",entry_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Offload entry id %d success.\n",entry_id);
|
||||
//printf("Offload entry id %d success.\n",entry_id);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -1091,11 +1091,11 @@ int main(int argc,char* argv[])
|
||||
test_set_cmd_line(feather);
|
||||
test_add_ip_command(feather,"IP_CONFIG");
|
||||
|
||||
Maat_set_feather_opt(feather, MAAT_OPT_DISABLE_UPDATE, &value, sizeof(value));
|
||||
Maat_set_feather_opt(feather, MAAT_OPT_ENABLE_UPDATE, &value, sizeof(value));
|
||||
printf("Disable background udpate.\n");
|
||||
test_set_cmd_line(feather);
|
||||
value=1;
|
||||
Maat_set_feather_opt(feather, MAAT_OPT_DISABLE_UPDATE, &value, sizeof(value));
|
||||
Maat_set_feather_opt(feather, MAAT_OPT_ENABLE_UPDATE, &value, sizeof(value));
|
||||
printf("Enable background udpate.\n");
|
||||
}
|
||||
test_sfh_digest(test_digest_file);
|
||||
|
||||
Reference in New Issue
Block a user