Added support for multiline options for routers and filters.

This commit is contained in:
Markus Makela
2015-08-25 23:38:49 +03:00
parent 9fe479e679
commit 72097fc30e
2 changed files with 24 additions and 1 deletions

View File

@ -174,12 +174,35 @@ CONFIG_PARAMETER *param, *p1;
{ {
if (!strcmp(p1->name, name)) if (!strcmp(p1->name, name))
{ {
if(strcmp(name,"router_options") == 0 || strcmp(name,"options"))
{
char* tmp;
if((tmp = malloc(sizeof(char) * (strlen(p1->value) + strlen(value) + 2))) == NULL)
{
skygw_log_write(LE,"[%s] Error: Memory allocation failed.",__FUNCTION__);
return 0;
}
strcpy(tmp,p1->value);
strcat(tmp,value);
free(p1->value);
p1->value = tmp;
if(p1->qfd_param_type == STRING_TYPE && p1->qfd.valstr != NULL)
{
free(p1->qfd.valstr);
p1->qfd.valstr = strdup(p1->value);
}
return 1;
}
else
{
LOGIF(LE, (skygw_log_write_flush( LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR, LOGFILE_ERROR,
"Error : Configuration object '%s' has multiple " "Error : Configuration object '%s' has multiple "
"parameters names '%s'.", "parameters names '%s'.",
ptr->object, name))); ptr->object, name)));
return 0; return 0;
}
} }
p1 = p1->next; p1 = p1->next;
} }

View File

@ -1,2 +1,2 @@
add_definitions(-DINI_MAX_LINE=1024) add_definitions(-DINI_MAX_LINE=1024 -DINI_ALLOW_MULTILINE)
add_library(inih ini.c) add_library(inih ini.c)