diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:20:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:20:30 +0000 |
commit | ddfc40eabdbc59a607b568e946fb116dcd3439fd (patch) | |
tree | b3253de65399448dbbf12e5b65d2da56c53d3af6 /src/listener.c | |
parent | Adding upstream version 2.9.6. (diff) | |
download | haproxy-4fe1ede9d99e666539dfb02078308ed77f501d8f.tar.xz haproxy-4fe1ede9d99e666539dfb02078308ed77f501d8f.zip |
Adding upstream version 2.9.7.upstream/2.9.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/listener.c')
-rw-r--r-- | src/listener.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/listener.c b/src/listener.c index 86d0945..75e164a 100644 --- a/src/listener.c +++ b/src/listener.c @@ -1602,6 +1602,22 @@ void listener_release(struct listener *l) if (fe && !MT_LIST_ISEMPTY(&fe->listener_queue) && (!fe->fe_sps_lim || freq_ctr_remain(&fe->fe_sess_per_sec, fe->fe_sps_lim, 0) > 0)) dequeue_proxy_listeners(fe); + else { + unsigned int wait; + int expire = TICK_ETERNITY; + + if (fe->task && fe->fe_sps_lim && + (wait = next_event_delay(&fe->fe_sess_per_sec,fe->fe_sps_lim, 0))) { + /* we're blocking because a limit was reached on the number of + * requests/s on the frontend. We want to re-check ASAP, which + * means in 1 ms before estimated expiration date, because the + * timer will have settled down. + */ + expire = tick_first(fe->task->expire, tick_add(now_ms, wait)); + if (tick_isset(expire)) + task_schedule(fe->task, expire); + } + } } /* Initializes the listener queues. Returns 0 on success, otherwise ERR_* flags */ @@ -2195,6 +2211,9 @@ int bind_parse_args_list(struct bind_conf *bind_conf, char **args, int cur_arg, */ if ((bind_conf->options & (BC_O_USE_SOCK_DGRAM|BC_O_USE_XPRT_STREAM)) == (BC_O_USE_SOCK_DGRAM|BC_O_USE_XPRT_STREAM)) { #ifdef USE_QUIC + struct listener *l __maybe_unused; + int listener_count __maybe_unused = 0; + bind_conf->xprt = xprt_get(XPRT_QUIC); if (!(bind_conf->options & BC_O_USE_SSL)) { bind_conf->options |= BC_O_USE_SSL; @@ -2202,6 +2221,17 @@ int bind_parse_args_list(struct bind_conf *bind_conf, char **args, int cur_arg, file, linenum, args[0], args[1], section); } quic_transport_params_init(&bind_conf->quic_params, 1); + +#if (!defined(IP_PKTINFO) && !defined(IP_RECVDSTADDR)) || !defined(IPV6_RECVPKTINFO) + list_for_each_entry(l, &bind_conf->listeners, by_bind) { + if (++listener_count > 1 || !is_inet_addr(&l->rx.addr)) { + ha_diag_warning("parsing [%s:%d] : '%s %s' in section '%s' : UDP binding on multiple addresses without IP_PKTINFO or equivalent support may be unreliable.\n", + file, linenum, args[0], args[1], section); + break; + } + } +#endif /* (!IP_PKTINFO && !IP_RECVDSTADDR) || !IPV6_RECVPKTINFO */ + #else ha_alert("parsing [%s:%d] : '%s %s' in section '%s' : QUIC protocol selected but support not compiled in (check build options).\n", file, linenum, args[0], args[1], section); |