summaryrefslogtreecommitdiff
path: root/libavformat/tls.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-07-27 20:22:51 +0300
committerMartin Storsjö <martin@martin.st>2012-07-28 01:21:16 +0300
commit41ecbbc7aa3d491cc9d8d425634c5901eefa088a (patch)
treeda6158e8e6e3595499c75c9aabe8d0b9fd9489b9 /libavformat/tls.c
parent76888c64b008bc3acf6e5fe5117a360f2c87aae4 (diff)
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: Antti Seppälä <a.seppala@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/tls.c')
-rw-r--r--libavformat/tls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/tls.c b/libavformat/tls.c
index fb84fa82b6..866e55f2ba 100644
--- a/libavformat/tls.c
+++ b/libavformat/tls.c
@@ -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;
}