From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E0C4840CD1 for ; Wed, 8 Jun 2022 21:16:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E729868B69C; Thu, 9 Jun 2022 00:16:47 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 372ED68B691 for ; Thu, 9 Jun 2022 00:16:41 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B4ED5E7281 for ; Wed, 8 Jun 2022 23:16:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c4wjOSXIe70w for ; Wed, 8 Jun 2022 23:16:38 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 3AACDE70D5 for ; Wed, 8 Jun 2022 23:16:38 +0200 (CEST) Date: Wed, 8 Jun 2022 23:16:38 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: Message-ID: <5f127652-b0c7-9e7f-6e1e-d9a3fd482f6f@passwd.hu> References: <20220523104433.201414-1-matthieu.bouron@gmail.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] libavformat/tls_libtls: handle TLS_WANT_{POLLIN, POLLOUT} in read/write functions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 30 May 2022, Matthieu Bouron wrote: > On Mon, May 23, 2022 at 12:44:33PM +0200, Matthieu Bouron wrote: >> According to the tls documentation: tls_read() and tls_write() can >> return TLS_WANT_POLLIN and TLS_WANT_POLLOUT which indicates that the >> same operation must be repeated immediately. >> >> This commit prevents the libtls backend from failing when libtls returns >> TLS_WANT_POLLIN or TLS_WANT_POLLOUT with the following error: >> >> [tls @ 0x7f6e20005a00] (null) >> --- >> libavformat/tls_libtls.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/libavformat/tls_libtls.c b/libavformat/tls_libtls.c >> index 911c8094b0..22858d4867 100644 >> --- a/libavformat/tls_libtls.c >> +++ b/libavformat/tls_libtls.c >> @@ -158,6 +158,8 @@ static int ff_tls_read(URLContext *h, uint8_t *buf, int size) >> return ret; >> else if (ret == 0) >> return AVERROR_EOF; >> + else if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) >> + return AVERROR(EAGAIN); >> av_log(h, AV_LOG_ERROR, "%s\n", tls_error(p->ctx)); >> return AVERROR(EIO); >> } >> @@ -171,6 +173,8 @@ static int ff_tls_write(URLContext *h, const uint8_t *buf, int size) >> return ret; >> else if (ret == 0) >> return AVERROR_EOF; >> + else if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) >> + return AVERROR(EAGAIN); >> av_log(h, AV_LOG_ERROR, "%s\n", tls_error(p->ctx)); >> return AVERROR(EIO); >> } >> -- > > Ping. Thanks, applied. Regards, Marton _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".