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@gmx.at>
(cherry picked from commit 2222f419da)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
wm4 2015-06-13 23:55:21 +02:00 committed by Michael Niedermayer
parent 6432f8826d
commit c3c8365dbd
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ static int tls_close(URLContext *h)
{ {
TLSContext *c = h->priv_data; TLSContext *c = h->priv_data;
if (c->need_shutdown) if (c->need_shutdown)
gnutls_bye(c->session, GNUTLS_SHUT_RDWR); gnutls_bye(c->session, GNUTLS_SHUT_WR);
if (c->session) if (c->session)
gnutls_deinit(c->session); gnutls_deinit(c->session);
if (c->cred) if (c->cred)