Commit ca41ed3f authored by François Cartegnie's avatar François Cartegnie 🤞

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

At least, fedora 20 doesn't enable it.
parent d5368889
...@@ -198,6 +198,7 @@ static int gnutls_SessionOpen (vlc_tls_t *tls, int type, ...@@ -198,6 +198,7 @@ static int gnutls_SessionOpen (vlc_tls_t *tls, int type,
goto error; goto error;
} }
#ifdef GNUTLS_ALPN_MAND
if (alpn != NULL) if (alpn != NULL)
{ {
gnutls_datum_t *protv = NULL; gnutls_datum_t *protv = NULL;
...@@ -222,6 +223,9 @@ static int gnutls_SessionOpen (vlc_tls_t *tls, int type, ...@@ -222,6 +223,9 @@ static int gnutls_SessionOpen (vlc_tls_t *tls, int type,
val = gnutls_alpn_set_protocols (session, protv, protc, 0); val = gnutls_alpn_set_protocols (session, protv, protc, 0);
free (protv); free (protv);
} }
#else
VLC_UNUSED(alpn);
#endif
gnutls_transport_set_int (session, fd); gnutls_transport_set_int (session, fd);
...@@ -275,6 +279,7 @@ static int gnutls_ContinueHandshake (vlc_tls_t *tls, char **restrict alp) ...@@ -275,6 +279,7 @@ static int gnutls_ContinueHandshake (vlc_tls_t *tls, char **restrict alp)
return -1; return -1;
done: done:
#ifdef GNUTLS_ALPN_MAND
if (alp != NULL) if (alp != NULL)
{ {
gnutls_datum_t datum; gnutls_datum_t datum;
...@@ -292,6 +297,9 @@ done: ...@@ -292,6 +297,9 @@ done:
else else
*alp = NULL; *alp = NULL;
} }
#else
VLC_UNUSED(alp);
#endif
return 0; return 0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment