From d3ad730d5fb9147b5d10a5c5be59e77add0a931f Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 19 Mar 2026 15:36:25 +0100 Subject: [PATCH] MINOR: protocols: Add a new proto_is_quic() function Add a new function, proto_is_quic(), that returns true if the protocol is QUIC (using a datagram socket but provides a stream transport). --- include/haproxy/protocol.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/haproxy/protocol.h b/include/haproxy/protocol.h index 7b14e1581..beb0632e3 100644 --- a/include/haproxy/protocol.h +++ b/include/haproxy/protocol.h @@ -124,6 +124,12 @@ static inline int real_family(int ss_family) return fam ? fam->real_family : AF_UNSPEC; } +static inline int proto_is_quic(const struct protocol *proto) +{ + return (proto->proto_type == PROTO_TYPE_DGRAM && + proto->xprt_type == PROTO_TYPE_STREAM); +} + #endif /* _HAPROXY_PROTOCOL_H */ /*