From 8b8038494ce8354a3e2cfffebba40dbd1328ebb9 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 3 Nov 2022 14:41:28 +0100 Subject: [PATCH] * src/gnutls.c (Fgnutls_available_p): Avoid duplicating capabilities. --- src/gnutls.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gnutls.c b/src/gnutls.c index a0de0238c47..7f0aaf85a41 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -2790,6 +2790,10 @@ Any GnuTLS extension with ID up to 100 capabilities = Fcons (intern("gnutls"), capabilities); +# ifdef HAVE_GNUTLS_EXT__DUMBFW + capabilities = Fcons (intern("ClientHello Padding"), capabilities); +# endif + # ifdef HAVE_GNUTLS3 capabilities = Fcons (intern("gnutls3"), capabilities); capabilities = Fcons (intern("digests"), capabilities); @@ -2807,16 +2811,14 @@ Any GnuTLS extension with ID up to 100 const char* name = gnutls_ext_get_name(ext); if (name != NULL) { - capabilities = Fcons (intern(name), capabilities); + Lisp_Object cap = intern (name); + if (NILP (Fmemq (cap, capabilities))) + capabilities = Fcons (cap, capabilities); } } # endif # endif /* HAVE_GNUTLS3 */ -# ifdef HAVE_GNUTLS_EXT__DUMBFW - capabilities = Fcons (intern("ClientHello Padding"), capabilities); -# endif - # ifdef WINDOWSNT Vlibrary_cache = Fcons (Fcons (Qgnutls, capabilities), Vlibrary_cache); # endif /* WINDOWSNT */ -- 2.39.2