]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: implement helper to identify QUIC servers
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 11 Jun 2025 15:28:46 +0000 (17:28 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 11 Jun 2025 16:37:19 +0000 (18:37 +0200)
Define srv_is_quic() which can be used to quickly identified if a server
uses QUIC protocol.

include/haproxy/server.h

index d261c6adf1531351d4eea91ac22b04b7b5fbb0ac..db134f1532b663f04a3e5a0f2145640d384ad71b 100644 (file)
@@ -343,6 +343,16 @@ static inline void srv_detach(struct server *srv)
        }
 }
 
+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 */
 
 /*