BUG/MINOR: mux-fcgi: Don't compare the filter name in its parsing callback

The function parse_fcgi_flt() is called when the keyword "fcgi-app" is found on
a filter line. We don't need to compare it again in the function.

This patch fixes the issue #284. No backport needed.
This commit is contained in:
Christopher Faulet 2019-09-18 11:18:33 +02:00
parent d432b3e5c8
commit 0ce57b05de

View File

@ -525,18 +525,17 @@ parse_fcgi_flt(char **args, int *cur_arg, struct proxy *px,
int pos = *cur_arg;
/* Get the fcgi-app name*/
if (!strcmp(args[pos], "fcgi-app")) {
if (!*args[pos + 1]) {
memprintf(err, "%s : expects a <name> argument", args[pos]);
goto err;
}
name = strdup(args[pos + 1]);
if (!name) {
memprintf(err, "%s '%s' : out of memory", args[pos], args[pos + 1]);
goto err;
}
pos += 2;
if (!*args[pos + 1]) {
memprintf(err, "%s : expects a <name> argument", args[pos]);
goto err;
}
name = strdup(args[pos + 1]);
if (!name) {
memprintf(err, "%s '%s' : out of memory", args[pos], args[pos + 1]);
goto err;
}
pos += 2;
/* Check if an fcgi-app filter with the same name already exists */
list_for_each_entry_safe(f, back, &px->filter_configs, list) {
if (f->id != fcgi_flt_id)
@ -575,7 +574,6 @@ parse_fcgi_flt(char **args, int *cur_arg, struct proxy *px,
return 0;
err:
free(name);
//free(fcgi_conf);
return -1;
}