struct rx_settings settings; /* all the settings needed for the listening socket */
};
+#define LI_F_QUIC_LISTENER 0x00000001 /* listener uses proto quic */
+
/* The listener will be directly referenced by the fdtab[] which holds its
* socket. The listener provides the protocol-specific accept() function to
* the fdtab.
#include <haproxy/log.h>
#include <haproxy/mailers.h>
#include <haproxy/namespace.h>
+#include <haproxy/quic_sock.h>
#include <haproxy/obj_type-t.h>
#include <haproxy/peers-t.h>
#include <haproxy/peers.h>
if (!listener->maxaccept)
listener->maxaccept = global.tune.maxaccept ? global.tune.maxaccept : MAX_ACCEPT;
- /* listener->accept may already be initialized by some
- * protocols so do not overwrite it in this case.
- */
- if (!listener->accept)
- listener->accept = session_accept_fd;
+ /* listener accept callback */
+ listener->accept = session_accept_fd;
+#ifdef USE_QUIC
+ /* override the accept callback for QUIC listeners. */
+ if (listener->flags & LI_F_QUIC_LISTENER)
+ listener->accept = quic_session_accept;
+#endif
listener->analysers |= curproxy->fe_req_ana;
listener->default_target = curproxy->default_target;
*/
static void quic_add_listener(struct protocol *proto, struct listener *listener)
{
- /* custom accept callback for QUIC */
- listener->accept = quic_session_accept;
+ listener->flags |= LI_F_QUIC_LISTENER;
MT_LIST_INIT(&listener->rx.pkts);
listener->rx.odcids = EB_ROOT_UNIQUE;