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 D8F0B40782 for ; Mon, 30 May 2022 14:58:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5C31768B612; Mon, 30 May 2022 17:58:28 +0300 (EEST) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C96C668B4B6 for ; Mon, 30 May 2022 17:58:26 +0300 (EEST) Received: by mail-wr1-f41.google.com with SMTP id t6so15024109wra.4 for ; Mon, 30 May 2022 07:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tCaPkrLlJil2nqZR/+YwxW2fNP5hty+/T7I5iZu7xZw=; b=Rrb/1kpXdIpAfJN5Z72Geyc0Uj7fXz1KU5AK/bVCkonkr2EtujObqC06LiB0xXejOT JaaBf7l3sQh7y2OIsXLjSd1XJqBE7y9aFJE29fIkhFCSWD1uaFTSFIvHiC4qIph/3Ir8 W2lqv7Rt/gmaqWaB8mEiZLDiIYtJCzt+2RzfnXI2zdHewjh5YLDgb83vwuYNepf8zznU jpt6cy8d78Pa0jToOfs+eUitkw80QDIsZ+Ztyuu+7zMq2gQXZG9bD4ya0oIAHUMZ++MD cyoZR1jPB1B2yl8TTO9Jfz+jPZIC/Y4gYFgmnhL+85OpJvWR3/CinVIjo2v/DBjjZP0B eHtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tCaPkrLlJil2nqZR/+YwxW2fNP5hty+/T7I5iZu7xZw=; b=hCXpyHkrwNOqlaB5bNESTstEMHLOOrMxZhMzf1si9pUcGfN3NiJq0o2cBFB8WVaw60 K/Usjm6wVvqipspEm+M/NaWj3W/Yte6dqWeCPdjgE9PuPQBbQsI3weJBDocx4PfcCElO MRrZIInNbnZsIrpjCXTZyVStqQxItetf5g/IZAA1VftqU9dfYo91/5jLiDCUj/hNnQ4h 0pY7KL9CkIrF/vl0gYctt1W7DJGbkw4roxaAEogUGgL53Fna4sZivBym5ftOHUjeU6He kDeZnnYpFrkqENO+quDIaIhmqt1MCMLCqzUXtbcSF7uZ4pUWe19KaVyY0ANurvotxkhs GlQw== X-Gm-Message-State: AOAM532Xmec7VOtHF0NX7xbaPj7fwai1KWxSEMK4lcqndUtVpKJ4OUli FHN5APImwS8H0NHBTPKfqsTzwsJjQH0= X-Google-Smtp-Source: ABdhPJwoAqyTrk3sT+WJBVF8LgajoXWeqkoIHi/lN4iuD/fbDtGDKH/PH8QZLE/o4Z+5LJVfFSmBSw== X-Received: by 2002:a05:6000:1542:b0:20f:f4fc:4cd3 with SMTP id 2-20020a056000154200b0020ff4fc4cd3mr24239044wry.299.1653922705900; Mon, 30 May 2022 07:58:25 -0700 (PDT) Received: from kusa (lputeaux-656-1-153-220.w217-128.abo.wanadoo.fr. [217.128.47.220]) by smtp.gmail.com with ESMTPSA id az18-20020adfe192000000b0021020517639sm6607086wrb.102.2022.05.30.07.58.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 07:58:25 -0700 (PDT) Date: Mon, 30 May 2022 16:58:15 +0200 From: Matthieu Bouron To: ffmpeg-devel@ffmpeg.org Message-ID: References: <20220523104433.201414-1-matthieu.bouron@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220523104433.201414-1-matthieu.bouron@gmail.com> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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. _______________________________________________ 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".