]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/gnutls.c (Fgnutls_available_p): Avoid duplicating capabilities.
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 3 Nov 2022 13:41:28 +0000 (14:41 +0100)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 3 Nov 2022 13:43:27 +0000 (14:43 +0100)
src/gnutls.c

index a0de0238c470fc70e6f8bf8c589829e2f4e81842..7f0aaf85a410f8a00917b46a242ae5acbca59be6 100644 (file)
@@ -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 */