X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Ftls_gnutls.c;h=e41156cc30ed162989e4e41c5d2244db1b749c78;hb=39977fff20048f1798a95c593d6034a0e73ebbe5;hp=e3c43683be57a9b9a31062227946c6d7e2ee592e;hpb=2d62e06ff6a9f3dbd78136c1dc4a315a727c6f00;p=ffmpeg diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c index e3c43683be5..e41156cc30e 100644 --- a/libavformat/tls_gnutls.c +++ b/libavformat/tls_gnutls.c @@ -182,11 +182,18 @@ 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 { + if (ff_check_interrupt(&h->interrupt_callback)) { + ret = AVERROR_EXIT; + goto fail; + } + + 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;