ipmatcher rule_id -> long long & scanner engine centralization

This commit is contained in:
liuwentan
2023-03-01 09:32:36 +08:00
parent a6fb2b6fdd
commit 1566a30002
63 changed files with 4695 additions and 115 deletions

View File

@@ -40,12 +40,12 @@ const char *foreign_key_prefix = "__FILE_";
const char *mr_op_str[] = {"DEL", "ADD", "RENEW_TIMEOUT"};
char *get_foreign_cont_filename(const char *table_name, int rule_id,
char *get_foreign_cont_filename(const char *table_name, long long rule_id,
const char *foreign_key, const char *dir)
{
char buffer[512] = {0};
snprintf(buffer, sizeof(buffer),"%s/%s-%d-%s", dir,
snprintf(buffer, sizeof(buffer),"%s/%s-%lld-%s", dir,
table_name, rule_id, foreign_key);
char *filename = ALLOC(char, strlen(buffer) + 1);
memcpy(filename, buffer, strlen(buffer));
@@ -363,12 +363,12 @@ int get_inc_key_list(long long instance_version, long long target_version,
int i = 0;
int j = 0;
char op_str[4] = {0};
char op_str[256] = {0}; // reply->element[i]->str length less than 256
struct serial_rule *s_rule = ALLOC(struct serial_rule, reply->elements);
for (i = 0, j = 0; i < (int)reply->elements; i++) {
assert(reply->element[i]->type == REDIS_REPLY_STRING);
int ret = sscanf(reply->element[i]->str, "%[^,],%[^,],%lu",
int ret = sscanf(reply->element[i]->str, "%[^,],%[^,],%lld",
op_str, s_rule[j].table_name, &(s_rule[j].rule_id));
if (ret != 3 || s_rule[i].rule_id < 0) {
log_error(logger, MODULE_REDIS_MONITOR,