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 A8A184099D for ; Wed, 2 Feb 2022 00:35:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5BE7568B2DA; Wed, 2 Feb 2022 02:35:17 +0200 (EET) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60CBA68B2BA for ; Wed, 2 Feb 2022 02:35:11 +0200 (EET) Received: by mail-wr1-f54.google.com with SMTP id v13so35097193wrv.10 for ; Tue, 01 Feb 2022 16:35:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=1O2h5+1Yw+iJTAg8WbkEsE8wPHFdlOcimqKgPupawDg=; b=aIjJeXpKwhwR40WDxGsn9qzNp9m24r04f0ztKHMlg7lDktX6QTr4mWJehLash+0U8o aIm6n4C3SXTHPSA72GvBtBi2XLtfMtnPbb0QYAk+xhWKeGWb9kVWt+xEgAsRv/Ghtv85 HSDt3kHps0luKAulScrUmqskN7NweLMQ0cNqJdyUi4TH4IaYfA/zOaDYv83KcvnlrBo7 dShGmbYgAeNN5F6sTDpMseB+J/xcDRGEuY9+9IwiJfaBKW3gW5R/mJBsuSHxGaYa/gL/ cluCRVS8HEONb9qsHwB9uHquwQ1pnWVlBtLEohmEm+mh44QpLonDWxaFhUvOZSi2c6Ut b2oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=1O2h5+1Yw+iJTAg8WbkEsE8wPHFdlOcimqKgPupawDg=; b=aE+B4hbUvPvckAUAQJ//+lnhpNj4kL6UK5PGulUvfYZYqaOkqGZ/MJnrrj0ZY/5Bzm Ts8RhkGWImMx304Rdd1s3AA5uy3VE/A1VaYRel76wZHEHC7HCMPEu7Ud33s7c37OIDaA 2cEnKkz8W44NLyLrOHFgIvV8+5UUsOzcRjUQgyELX51ODcLo9ELr2r3TZNQAIKkzVtwV ZQCTXs+wW14NQLqDgCh7IQhO8TwVQLQIh3Q05QmqVJdUskLbeu7U8BmsuFQnTTvVcIjB uC27A8R/cZelyImzzqLSlKDXVaB2TzuiuQtgW0kXlaLPG+GypOg67dn5sQ4XK8Pf0/Wd LIiQ== X-Gm-Message-State: AOAM530IcKoVurrDa/eTEm/LDLU8oq+DmAA7eCANTx2o0umCtZkqmar2 +AEnRsRtOvDfnwIjWAnP+PNuWGEYXMSAxB3+wnjo3g68LV9mAg== X-Google-Smtp-Source: ABdhPJzUdtpSUI4qter5SzAo80XFnY2IGkBvci8TOv3JCGqDmClek6TVPPQpwVdDLrp6jXauQXx4YcUskbH6p71xsB0= X-Received: by 2002:adf:e411:: with SMTP id g17mr6384217wrm.275.1643762110478; Tue, 01 Feb 2022 16:35:10 -0800 (PST) MIME-Version: 1.0 References: <20220201215830.65635-1-markg85@gmail.com> <20220201215830.65635-2-markg85@gmail.com> <65259fb0-1c02-2d1d-ca8c-ed55801f5181@rothenpieler.org> In-Reply-To: <65259fb0-1c02-2d1d-ca8c-ed55801f5181@rothenpieler.org> From: Mark Gaiser Date: Wed, 2 Feb 2022 01:33:52 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH v2 1/1] avformat: Add IPFS protocol support. 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 Wed, Feb 2, 2022 at 1:27 AM Timo Rothenpieler wrote: > On 01.02.2022 22:58, Mark Gaiser wrote: > > +static int translate_ipfs_to_http(URLContext *h, const char *uri, int > flags, AVDictionary **options) > > +{ > > + const char *ipfs_cid; > > + const char *protocol_path_suffix = "ipfs/"; > > + char *fulluri; > > + int ret; > > + Context *c = h->priv_data; > > + int is_ipfs = (av_strstart(uri, "ipfs://", &ipfs_cid) || > av_strstart(uri, "ipfs:", &ipfs_cid)); > > + int is_ipns = (av_strstart(uri, "ipns://", &ipfs_cid) || > av_strstart(uri, "ipns:", &ipfs_cid)); > > What's the point of this logic? > The first half of each check seems pointless, since the second half is > true for everything the first one would cover. > Hi Time, The point it to allow ipfs:// and ipfs: So for that i want to test for all possible true situations (ipfs://, ipfs:, ipns:// and ipns:). This is akin to other protocols who seem to do the same check. Look at crypto.c for example. Another point is further down where the url is composed. If it's ipfs it becomes a url like /ipfs And for ipns: /ipns > > _______________________________________________ > 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". > _______________________________________________ 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".