[FFmpeg-cvslog] avformat/tls_openssl: unset nonblock flag on correct URLContext during dtls handshake

Timo Rothenpieler git at videolan.org
Thu Jul 17 03:37:22 EEST 2025


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Thu Jul 17 02:11:00 2025 +0200| [95eae5dd507f8922250bede2ef4aef95efab1afb] | committer: Timo Rothenpieler

avformat/tls_openssl: unset nonblock flag on correct URLContext during dtls handshake

The internal BIO functions do not in fact look at this flag, only the outer
tls_read and tls_write functions do.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95eae5dd507f8922250bede2ef4aef95efab1afb
---

 libavformat/tls_openssl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 8200c644a9..d6d102f8bb 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -702,8 +702,7 @@ static int dtls_handshake(URLContext *h)
     int ret = 1, r0, r1;
     TLSContext *p = h->priv_data;
 
-    int was_nonblock = h->flags & AVIO_FLAG_NONBLOCK;
-    h->flags &= ~AVIO_FLAG_NONBLOCK;
+    p->tls_shared.udp->flags &= ~AVIO_FLAG_NONBLOCK;
 
     r0 = SSL_do_handshake(p->ssl);
     if (r0 <= 0) {
@@ -724,8 +723,6 @@ static int dtls_handshake(URLContext *h)
     ret = 0;
     p->tls_shared.state = DTLS_STATE_FINISHED;
 end:
-    if (was_nonblock)
-        h->flags |= AVIO_FLAG_NONBLOCK;
     return ret;
 }
 



More information about the ffmpeg-cvslog mailing list