Ensure that QUIC support is compiled into haproxy when a QUIC server is
configured. This check is performed during _srv_parse_finalize() so that
it is detected both on configuration parsing and when adding a dynamic
server via the CLI.
Note that this changes the behavior of srv_is_quic() utility function.
Previously, it always returned false when QUIC support wasn't compiled.
With this new check introduced, it is now guaranteed that a QUIC server
won't exist if compilation support is not active. Hence srv_is_quic()
does not rely anymore on USE_QUIC define.
static inline int srv_is_quic(const struct server *srv)
{
-#ifdef USE_QUIC
return srv->addr_type.proto_type == PROTO_TYPE_DGRAM &&
srv->addr_type.xprt_type == PROTO_TYPE_STREAM;
-#else
- return 0;
-#endif
}
#endif /* _HAPROXY_SERVER_H */
}
}
-#ifdef USE_QUIC
if (srv_is_quic(srv)) {
+#ifdef USE_QUIC
if (!srv->use_ssl) {
srv->use_ssl = 1;
ha_warning("QUIC protocol detected, enabling ssl. Use 'ssl' to shut this warning.\n");
&srv->ssl_ctx.alpn_len, &errmsg) != 0) {
return ERR_ALERT | ERR_FATAL;
}
- }
+#else
+ ha_alert("QUIC protocol selected but support not compiled in (check build options).\n");
+ return ERR_ALERT | ERR_FATAL;
#endif
+ }
if (!(srv->proxy->cap & PR_CAP_LB)) {
/* No need to wait for effective proxy mode, it is already known: