ipmatcher rule_id -> long long & scanner engine centralization
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user