[FFmpeg-cvslog] tls_gnutls: fix hang on disconnection

wm4 git at videolan.org
Thu Jun 18 22:18:19 CEST 2015


ffmpeg | branch: release/2.7 | wm4 <nfxjfg at googlemail.com> | Sat Jun 13 23:55:21 2015 +0200| [c3c8365dbd3b677207998e5120f7b78850e3532c] | committer: Michael Niedermayer

tls_gnutls: fix hang on disconnection

GNUTLS_SHUT_RDWR means GnuTLS will keep waiting for the server's
termination reply. But since we don't shutdown the TCP connection at
this point yet, GnuTLS will just keep skipping actual data from the
server, which basically is perceived as hang.

Use GNUTLS_SHUT_WR instead, which doesn't have this problem.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 2222f419da99ef85d49ab04e7e15b76612f4d054)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/tls_gnutls.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index 942ece9..6388f37 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -87,7 +87,7 @@ static int tls_close(URLContext *h)
 {
     TLSContext *c = h->priv_data;
     if (c->need_shutdown)
-        gnutls_bye(c->session, GNUTLS_SHUT_RDWR);
+        gnutls_bye(c->session, GNUTLS_SHUT_WR);
     if (c->session)
         gnutls_deinit(c->session);
     if (c->cred)



More information about the ffmpeg-cvslog mailing list