[vlc-commits] gnutls: don't break if ALPN extension is not available

Francois Cartegnie git at videolan.org
Sat Aug 30 06:59:04 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Aug 30 13:51:36 2014 +0900| [ca41ed3fb28503ad1d0b6fbe1badaf21d940159e] | committer: Francois Cartegnie

gnutls: don't break if ALPN extension is not available

At least, fedora 20 doesn't enable it.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ca41ed3fb28503ad1d0b6fbe1badaf21d940159e
---

 modules/misc/gnutls.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index 7f40125..18e1985 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -198,6 +198,7 @@ static int gnutls_SessionOpen (vlc_tls_t *tls, int type,
         goto error;
     }
 
+#ifdef GNUTLS_ALPN_MAND
     if (alpn != NULL)
     {
         gnutls_datum_t *protv = NULL;
@@ -222,6 +223,9 @@ static int gnutls_SessionOpen (vlc_tls_t *tls, int type,
         val = gnutls_alpn_set_protocols (session, protv, protc, 0);
         free (protv);
     }
+#else
+    VLC_UNUSED(alpn);
+#endif
 
     gnutls_transport_set_int (session, fd);
 
@@ -275,6 +279,7 @@ static int gnutls_ContinueHandshake (vlc_tls_t *tls, char **restrict alp)
     return -1;
 
 done:
+#ifdef GNUTLS_ALPN_MAND
     if (alp != NULL)
     {
         gnutls_datum_t datum;
@@ -292,6 +297,9 @@ done:
         else
             *alp = NULL;
     }
+#else
+    VLC_UNUSED(alp);
+#endif
     return 0;
 }
 



More information about the vlc-commits mailing list