tls_openssl: Fix checks for SSL_ERROR_WANT_WRITE in nonblocking operation

Message ID 20180816075733.56306-1-martin@martin.st
State Committed
Commit 6a9c00c09d2bc50c0ea64ba092b2f4afc46aa978
Headers show
Series
  • tls_openssl: Fix checks for SSL_ERROR_WANT_WRITE in nonblocking operation
Related show

Commit Message

Martin Storsjö Aug. 16, 2018, 7:57 a.m.
This was a typo in 0671eb2346c, spotted by Chris Carroux.
---
 libavformat/tls_openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato Aug. 16, 2018, 11:18 a.m. | #1
On 16/08/2018 09:57, Martin Storsjö wrote:
> This was a typo in 0671eb2346c, spotted by Chris Carroux.
> ---
>  libavformat/tls_openssl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
> index f0b325ae98..4a2fcfd771 100644
> --- a/libavformat/tls_openssl.c
> +++ b/libavformat/tls_openssl.c
> @@ -112,7 +112,7 @@ static int print_tls_error(URLContext *h, int ret)
>      TLSContext *c = h->priv_data;
>      if (h->flags & AVIO_FLAG_NONBLOCK) {
>          int err = SSL_get_error(c->ssl, ret);
> -        if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_READ)
> +        if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
>              return AVERROR(EAGAIN);
>      }
>      av_log(h, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL));
> 

Sure

Patch

diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index f0b325ae98..4a2fcfd771 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -112,7 +112,7 @@  static int print_tls_error(URLContext *h, int ret)
     TLSContext *c = h->priv_data;
     if (h->flags & AVIO_FLAG_NONBLOCK) {
         int err = SSL_get_error(c->ssl, ret);
-        if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_READ)
+        if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
             return AVERROR(EAGAIN);
     }
     av_log(h, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL));