mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-18 05:24:42 +00:00
avformat/tls_mbedtls: Pass FLAG_NONBLOCK to underlying transport
This fix rtmps failure since rtmps requires nonblocking read. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
2a7d622ddd
commit
65c1c83ca4
@ -310,6 +310,8 @@ static int tls_read(URLContext *h, uint8_t *buf, int size)
|
||||
TLSContext *tls_ctx = h->priv_data;
|
||||
int ret;
|
||||
|
||||
tls_ctx->tls_shared.tcp->flags &= ~AVIO_FLAG_NONBLOCK;
|
||||
tls_ctx->tls_shared.tcp->flags |= h->flags & AVIO_FLAG_NONBLOCK;
|
||||
if ((ret = mbedtls_ssl_read(&tls_ctx->ssl_context, buf, size)) > 0) {
|
||||
// return read length
|
||||
return ret;
|
||||
@ -323,6 +325,8 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size)
|
||||
TLSContext *tls_ctx = h->priv_data;
|
||||
int ret;
|
||||
|
||||
tls_ctx->tls_shared.tcp->flags &= ~AVIO_FLAG_NONBLOCK;
|
||||
tls_ctx->tls_shared.tcp->flags |= h->flags & AVIO_FLAG_NONBLOCK;
|
||||
if ((ret = mbedtls_ssl_write(&tls_ctx->ssl_context, buf, size)) > 0) {
|
||||
// return written length
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user