From 74ea1167d91ccb2e1f2943efa030f2c278b598be Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 14 Jun 2015 17:12:53 +0200 Subject: tls_gnutls: fix hang on disconnection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Martin Storsjö --- libavformat/tls_gnutls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/tls_gnutls.c') diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c index 0fade36ed6..a5d7e890ab 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) -- cgit v1.2.3