From patchwork Sat Oct 17 01:36:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6JSh5piK5Yed?= X-Patchwork-Id: 23027 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0399844A445 for ; Sat, 17 Oct 2020 04:37:23 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB82F68B9EB; Sat, 17 Oct 2020 04:37:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3511D68B6CB for ; Sat, 17 Oct 2020 04:37:16 +0300 (EEST) Received: by mail-pf1-f194.google.com with SMTP id 144so2488737pfb.4 for ; Fri, 16 Oct 2020 18:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KSnBc2SZ4FFcq5Y/qFJZmk77ZcF2Wm9D0Ym52VWPJzU=; b=BJPRFCW3qa2ThjHhIWzzn8Bqw3CEYIkTXdQ8KheJlOFFfN4RhjOdyx74ojQ/7boGSC qBVGs6+EIibUODVCpjcTicaety+mbXlIwDz9zMfFVop7lGSAYaqgNPvqo8O/0Lzz3Vld mCRc5ac4LqXM/vr+ltCZfyTd4zs+hwhHQCRDHvVlWpreeCin4pmg5DYvWmosEO99zUhc HPJ0t1+SM1Sh1BJhWHGuhBQcd15GMXFOa6O9NVrPLSaedup8O+duAvj323PUF/vdTomO MXb/ynQRD881PAoIPddHW6FtkV0t8D0OkK4J6aF4aTEilrx3JOcqY5lkGrX8d/mYYLhD MxkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KSnBc2SZ4FFcq5Y/qFJZmk77ZcF2Wm9D0Ym52VWPJzU=; b=g3LnuWHHhGzyRnbkAcXdbYQeTzG3veJ4nQZL2iEC6+edjTFr7Wu3tsfrEboFkra7gi D/CoM7cO3tE3BuXcEi9UZLGKKj7HvAlRJWH1nf4xKztLnnGYhy6ITtvHDUCV4cz0N+aG XBEZCt3dC8dI9P031el/bSFOlFS2VnO1mLhleYBwgNeB4A9iGsqbYwBpp1L3kALYx+nT jFkNiyNkaKlo8wYj4oNJOgY7c+o5nW4xIoO+2MD0zapGlbcQrG7atUMvZ7Af7qJa5UI9 tVseU7m1iGkL6mNVwc1H3dZ+DAmqsXFufs4RPmSi8OlFmdZXQf1gzozhrq4uhssEdJv3 7tQA== X-Gm-Message-State: AOAM531EdyREKWiCSh8Fw3GVP1fZXhPxXY3TFCj9rc+KwJYue5QtXPv5 nO24RTeFs9iJFEGBxwqcmURgF3NEuEt7PXja X-Google-Smtp-Source: ABdhPJy28ho+pUzAkeTNjU5ltq8IZnpHszD1xB4DZ6cnZu0ktIY+E8f5165supzzpvkCWQNfUNSJmA== X-Received: by 2002:a63:5d44:: with SMTP id o4mr5331866pgm.409.1602898634130; Fri, 16 Oct 2020 18:37:14 -0700 (PDT) Received: from localhost.localdomain ([113.65.228.192]) by smtp.gmail.com with ESMTPSA id y191sm3963084pfb.175.2020.10.16.18.37.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2020 18:37:13 -0700 (PDT) From: caihaoning83@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sat, 17 Oct 2020 09:36:46 +0800 Message-Id: <20201017013646.39268-1-caihaoning83@gmail.com> X-Mailer: git-send-email 2.24.1 (Apple Git-126) MIME-Version: 1.0 Subject: [FFmpeg-devel] =?utf-8?q?=5BPATCH_v2=5D_lavf/url=3A_fix_rel_path?= =?utf-8?q?=E2=80=99s_query_string_contains_=3A/?= X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: "ruiquan.crq" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: "ruiquan.crq" Signed-off-by: ruiquan.crq --- libavformat/tests/url.c | 1 + libavformat/url.c | 2 +- tests/ref/fate/url | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c index 2440ae08bc..c294795fa2 100644 --- a/libavformat/tests/url.c +++ b/libavformat/tests/url.c @@ -90,6 +90,7 @@ int main(void) test_decompose("http://[::1]/dev/null"); test_decompose("http://[::1]:8080/dev/null"); test_decompose("//ffmpeg/dev/null"); + test_decompose("test?url=http://server/path"); printf("Testing ff_make_absolute_url:\n"); test(NULL, "baz"); diff --git a/libavformat/url.c b/libavformat/url.c index 3c858f0257..da5950723e 100644 --- a/libavformat/url.c +++ b/libavformat/url.c @@ -97,7 +97,7 @@ int ff_url_decompose(URLComponents *uc, const char *url, const char *end) /* scheme */ uc->scheme = cur; - p = find_delim(":/", cur, end); /* lavf "schemes" can contain options */ + p = find_delim(":/?", cur, end); /* lavf "schemes" can contain options, or "schemes" can't contains characters['?']*/ if (*p == ':') cur = p + 1; diff --git a/tests/ref/fate/url b/tests/ref/fate/url index 7e6395c47b..a9db0251f1 100644 --- a/tests/ref/fate/url +++ b/tests/ref/fate/url @@ -43,6 +43,10 @@ http://[::1]:8080/dev/null => host: ffmpeg path: /dev/null +test?url=http://server/path => + path: test + query: ?url=http://server/path + Testing ff_make_absolute_url: (null) baz => baz /foo/bar baz => /foo/baz