File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 1212#include <haproxy/mux_quic-t.h>
1313#include <haproxy/stconn.h>
1414
15+ #include <haproxy/h3.h>
16+ #include <haproxy/hq_interop.h>
17+
1518#define qcc_report_glitch (qcc , inc , ...) ({ \
1619 COUNT_GLITCH(__VA_ARGS__); \
1720 _qcc_report_glitch(qcc, inc); \
@@ -115,6 +118,16 @@ void qcc_show_quic(struct qcc *qcc);
115118
116119void qcc_wakeup (struct qcc * qcc );
117120
121+ static inline const struct qcc_app_ops * quic_alpn_to_app_ops (const char * alpn , int alpn_len )
122+ {
123+ if (alpn_len >= 2 && memcmp (alpn , "h3" , 2 ) == 0 )
124+ return & h3_ops ;
125+ else if (alpn_len >= 10 && memcmp (alpn , "hq-interop" , 10 ) == 0 )
126+ return & hq_interop_ops ;
127+
128+ return NULL ;
129+ }
130+
118131#endif /* USE_QUIC */
119132
120133#endif /* _HAPROXY_MUX_QUIC_H */
Original file line number Diff line number Diff line change 3838#include <haproxy/freq_ctr.h>
3939#include <haproxy/frontend.h>
4040#include <haproxy/global.h>
41- #include <haproxy/h3.h>
42- #include <haproxy/hq_interop.h>
4341#include <haproxy/log.h>
4442#include <haproxy/mux_quic.h>
4543#include <haproxy/ncbuf.h>
@@ -274,14 +272,11 @@ void quic_set_tls_alert(struct quic_conn *qc, int alert)
274272 */
275273int quic_set_app_ops (struct quic_conn * qc , const char * alpn , int alpn_len )
276274{
277- if (alpn_len >= 2 && memcmp (alpn , "h3" , 2 ) == 0 )
278- qc -> app_ops = & h3_ops ;
279- else if (alpn_len >= 10 && memcmp (alpn , "hq-interop" , 10 ) == 0 )
280- qc -> app_ops = & hq_interop_ops ;
281- else
275+ if (!(qc -> app_ops = quic_alpn_to_app_ops (alpn , alpn_len )))
282276 return 0 ;
283277
284278 return 1 ;
279+
285280}
286281
287282/* Try to reuse <alpn> ALPN and <etps> early transport parameters.
You can’t perform that action at this time.
0 commit comments