From: Olivier Houchard Date: Thu, 19 Mar 2026 14:36:25 +0000 (+0100) Subject: MINOR: protocols: Add a new proto_is_quic() function X-Git-Tag: v3.4-dev8~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d3ad730d5fb9147b5d10a5c5be59e77add0a931f;p=thirdparty%2Fhaproxy.git 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). --- 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 */ /*