[FFmpeg-cvslog] lavf/tls_gnutls: retry gnutls_handshake on non fatal errors

Remita Amine git at videolan.org
Fri Sep 4 22:29:34 EEST 2020


ffmpeg | branch: release/4.0 | Remita Amine <remitamine at gmail.com> | Wed Mar 27 13:03:07 2019 +0100| [90f9f23279c179acf2ac6ea83efa689a53c460d3] | committer: Jan Ekström

lavf/tls_gnutls: retry gnutls_handshake on non fatal errors

fixes #7801

Signed-off-by: Remita Amine <remitamine at gmail.com>
(cherry picked from commit bc1749c6e46099ec85110361dbe6f7994a63040d)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=90f9f23279c179acf2ac6ea83efa689a53c460d3
---

 libavformat/tls_gnutls.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index e3c43683be..f32bc2821b 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -182,11 +182,13 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op
     gnutls_transport_set_push_function(p->session, gnutls_url_push);
     gnutls_transport_set_ptr(p->session, c->tcp);
     gnutls_priority_set_direct(p->session, "NORMAL", NULL);
-    ret = gnutls_handshake(p->session);
-    if (ret) {
-        ret = print_tls_error(h, ret);
-        goto fail;
-    }
+    do {
+        ret = gnutls_handshake(p->session);
+        if (gnutls_error_is_fatal(ret)) {
+            ret = print_tls_error(h, ret);
+            goto fail;
+        }
+    } while (ret);
     p->need_shutdown = 1;
     if (c->verify) {
         unsigned int status, cert_list_size;



More information about the ffmpeg-cvslog mailing list