#include <haproxy/mux_quic-t.h>
#include <haproxy/stconn.h>
+#include <haproxy/h3.h>
+#include <haproxy/hq_interop.h>
+
#define qcc_report_glitch(qcc, inc, ...) ({ \
COUNT_GLITCH(__VA_ARGS__); \
_qcc_report_glitch(qcc, inc); \
void qcc_wakeup(struct qcc *qcc);
+static inline const struct qcc_app_ops *quic_alpn_to_app_ops(const char *alpn, int alpn_len)
+{
+ if (alpn_len >= 2 && memcmp(alpn, "h3", 2) == 0)
+ return &h3_ops;
+ else if (alpn_len >= 10 && memcmp(alpn, "hq-interop", 10) == 0)
+ return &hq_interop_ops;
+
+ return NULL;
+}
+
#endif /* USE_QUIC */
#endif /* _HAPROXY_MUX_QUIC_H */
#include <haproxy/freq_ctr.h>
#include <haproxy/frontend.h>
#include <haproxy/global.h>
-#include <haproxy/h3.h>
-#include <haproxy/hq_interop.h>
#include <haproxy/log.h>
#include <haproxy/mux_quic.h>
#include <haproxy/ncbuf.h>
*/
int quic_set_app_ops(struct quic_conn *qc, const char *alpn, int alpn_len)
{
- if (alpn_len >= 2 && memcmp(alpn, "h3", 2) == 0)
- qc->app_ops = &h3_ops;
- else if (alpn_len >= 10 && memcmp(alpn, "hq-interop", 10) == 0)
- qc->app_ops = &hq_interop_ops;
- else
+ if (!(qc->app_ops = quic_alpn_to_app_ops(alpn, alpn_len)))
return 0;
return 1;
+
}
/* Try to reuse <alpn> ALPN and <etps> early transport parameters.