Skip to content
Snippets Groups Projects
Commit 41ecbbc7 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

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: default avatarAntti Seppälä <a.seppala@gmail.com>
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 76888c64
No related branches found
No related tags found
No related merge requests found
...@@ -209,7 +209,7 @@ static int tls_read(URLContext *h, uint8_t *buf, int size) ...@@ -209,7 +209,7 @@ static int tls_read(URLContext *h, uint8_t *buf, int size)
if (ret > 0) if (ret > 0)
return ret; return ret;
if (ret == 0) if (ret == 0)
return AVERROR(EIO); return AVERROR_EOF;
if ((ret = do_tls_poll(h, ret)) < 0) if ((ret = do_tls_poll(h, ret)) < 0)
return ret; return ret;
} }
...@@ -224,7 +224,7 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size) ...@@ -224,7 +224,7 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size)
if (ret > 0) if (ret > 0)
return ret; return ret;
if (ret == 0) if (ret == 0)
return AVERROR(EIO); return AVERROR_EOF;
if ((ret = do_tls_poll(h, ret)) < 0) if ((ret = do_tls_poll(h, ret)) < 0)
return ret; return ret;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment