else
bind_conf->options |= BC_O_USE_XPRT_STREAM;
-#ifdef USE_QUIC
- /* The transport layer automatically switches to QUIC when QUIC
- * is selected, regardless of bind_conf settings. We then need
- * to initialize QUIC params.
- */
- if (proto->proto_type == PROTO_TYPE_DGRAM && proto->xprt_type == PROTO_TYPE_STREAM) {
- bind_conf->xprt = xprt_get(XPRT_QUIC);
- quic_transport_params_init(&bind_conf->quic_params, 1);
- }
-#endif
if (!create_listeners(bind_conf, ss2, port, end, fd, proto, err)) {
memprintf(err, "%s for address '%s'.\n", *err, str);
goto fail;
#include <haproxy/task.h>
#include <haproxy/ticks.h>
#include <haproxy/tools.h>
+#include <haproxy/xprt_quic.h>
/* List head of all known bind keywords */
goto out;
}
+ /* The transport layer automatically switches to QUIC when QUIC is
+ * selected, regardless of bind_conf settings. We then need to
+ * initialize QUIC params.
+ */
+ 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
+ bind_conf->xprt = xprt_get(XPRT_QUIC);
+ quic_transport_params_init(&bind_conf->quic_params, 1);
+#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);
+ err_code |= ERR_ALERT | ERR_FATAL;
+ goto out;
+#endif
+ }
+
out:
return err_code;
}