Commit 41ecbbc7 authored by Martin Storsjö's avatar Martin Storsjö

tls: Return AVERROR_EOF if the TLS_read/write functions return 0

OpenSSL returns 0 when the peer has closed the connection. GnuTLS
doesn't return that though, but returns
GNUTLS_E_UNEXPECTED_PACKET_LENGTH if the connection simply is closed
without a clean close notify packet.
Tested-by: 's avatarAntti Seppälä <a.seppala@gmail.com>
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 76888c64
......@@ -209,7 +209,7 @@ static int tls_read(URLContext *h, uint8_t *buf, int size)
if (ret > 0)
return ret;
if (ret == 0)
return AVERROR(EIO);
return AVERROR_EOF;
if ((ret = do_tls_poll(h, ret)) < 0)
return ret;
}
......@@ -224,7 +224,7 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size)
if (ret > 0)
return ret;
if (ret == 0)
return AVERROR(EIO);
return AVERROR_EOF;
if ((ret = do_tls_poll(h, ret)) < 0)
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment