mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
BUG/MINOR: cache: Don't needlessly test "cache" keyword in parse_cache_flt()
parse_cache_flt() is the registered callback for the "cache" filter keyword. It is only called when the "cache" keyword is found on a filter line. So, it is useless to test the filter name in the callback function. This patch should fix the issue #634. It may be backported as far as 1.9.
This commit is contained in:
parent
3b78809de0
commit
2a37cdbe6b
@ -1411,8 +1411,7 @@ parse_cache_flt(char **args, int *cur_arg, struct proxy *px,
|
|||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
int pos = *cur_arg;
|
int pos = *cur_arg;
|
||||||
|
|
||||||
/* Get the cache filter name*/
|
/* Get the cache filter name. <pos> point on "cache" keyword */
|
||||||
if (!strcmp(args[pos], "cache")) {
|
|
||||||
if (!*args[pos + 1]) {
|
if (!*args[pos + 1]) {
|
||||||
memprintf(err, "%s : expects an <id> argument", args[pos]);
|
memprintf(err, "%s : expects an <id> argument", args[pos]);
|
||||||
goto error;
|
goto error;
|
||||||
@ -1423,7 +1422,6 @@ parse_cache_flt(char **args, int *cur_arg, struct proxy *px,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
pos += 2;
|
pos += 2;
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if an implicit filter with the same name already exists. If so,
|
/* Check if an implicit filter with the same name already exists. If so,
|
||||||
* we remove the implicit filter to use the explicit one. */
|
* we remove the implicit filter to use the explicit one. */
|
||||||
|
Loading…
Reference in New Issue
Block a user