mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
MINOR: log: detect LOG_TARGET_FD from the fd and not from the syntax
Now that we have the FD value reported we don't need to cheat and detect "fd@" in the address, we can safely rely on the FD value.
This commit is contained in:
parent
a93e5c7fae
commit
895992619d
@ -803,6 +803,7 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, char **err)
|
||||
struct logsrv *logsrv = NULL;
|
||||
int port1, port2;
|
||||
int cur_arg;
|
||||
int fd;
|
||||
|
||||
/*
|
||||
* "no log": delete previous herited or defined syslog
|
||||
@ -1018,13 +1019,13 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, char **err)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (strncmp(args[1], "fd@", 3) == 0)
|
||||
logsrv->type = LOG_TARGET_FD;
|
||||
|
||||
sk = str2sa_range(args[1], NULL, &port1, &port2, NULL,
|
||||
sk = str2sa_range(args[1], NULL, &port1, &port2, &fd,
|
||||
err, NULL, NULL, PA_O_RESOLVE | PA_O_PORT_OK | PA_O_RAW_FD | PA_O_DGRAM);
|
||||
if (!sk)
|
||||
goto error;
|
||||
|
||||
if (fd != -1)
|
||||
logsrv->type = LOG_TARGET_FD;
|
||||
logsrv->addr = *sk;
|
||||
|
||||
/* handle nicely the case where "udp@" is forced */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user