From patchwork Sat Feb 8 21:18:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17729 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a05:6214:1865:0:0:0:0 with SMTP id eh5csp972297qvb; Sat, 8 Feb 2020 13:19:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxbi70d5Q5c3NXyOA+1ys1xmHWR42q/dE4bMnWpMTYmVcsYhZbZyjTeP0aK5S4cHVIGAGyC X-Received: by 2002:a17:906:7d17:: with SMTP id u23mr5437728ejo.318.1581196751427; Sat, 08 Feb 2020 13:19:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581196751; cv=none; d=google.com; s=arc-20160816; b=KKRDz9SBCyvWieHFh/qkdepE0BPlKAGJVyTe/aSmpdTjpPk63zi5mibz4qU/HyOW5D uJYLD/Kj7JqcZ5nKjIts5VveloERqCvT5OYwmVMFN3NeST+uNSGPDGhE0wTHvfsK8ZRk pwTNBjaAqXS5peyc6d2a0pPMAUR32L//V/xXllW7eIYnHdlGQXyz3TFyseuPf+Sp0NwA 7qSfdn5tiLOvwYM66TamU+JmgKRd2uqX1mXyEqum+cs3F0jeuktURfEqCatl7h5PYmQH X/Us6AEEN4ZEiGseiQB3ypjXEH8ZUMNZ7ejWo0Bs02C1gPFSe2m/E85gKu4Kf/m9wyMR 3VSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=JD+Dx4QwZ7ZPylGJNYQGiwiXxPLU/wHWV3P9sUSW4pY=; b=FqWNhiFK/fyNZ+y2pygpc6xMnh9ckVGTPeU1kHaLVsAePwxrITqDMMeXldxjGPaNFx fTLl9dzW2D5hEZ+Je52Z0u/BZnnBxFTnd+8Vw7Lpx8bWQweWodUt3TFjProEgPPOfGoe ivtaR0zcC7ABvO6K6hy3gmCcByC9iQczqpdwbGSy4D5TRFitLJisfdQpPijjoWEyjZHt 655AUWLvqkaT4FD1GyiPqXmkds6fqsp+woO4+hUC/4BGbh9l51oUFD+aXOlPdsRrryca nJmdAVSpd52yYzN/w74kavBt/rf30PIsDdXdSfz9WTsR76zc1mBWd3prR9ymiZGEFQ0E fxTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r26si1862120edp.608.2020.02.08.13.19.11; Sat, 08 Feb 2020 13:19:11 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CBEB868B082; Sat, 8 Feb 2020 23:19:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1727A68B039 for ; Sat, 8 Feb 2020 23:18:58 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id ECF8CE3B91; Sat, 8 Feb 2020 22:18:57 +0100 (CET) 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 m1lhC1fVj5-U; Sat, 8 Feb 2020 22:18:56 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 86836E3ABE; Sat, 8 Feb 2020 22:18:56 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 Feb 2020 22:18:15 +0100 Message-Id: <20200208211823.31345-4-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200208211823.31345-1-cus@passwd.hu> References: <20200208211823.31345-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 04/12] avformat/http: split the fragment part from the HTTP URL before the request 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: fPTfiECHlvVX Content-Length: 1881 RFC 3986 states that the fragment identifier is separated from the rest of the URI prior to a dereference, and thus the identifying information within the fragment itself is dereferenced solely by the user agent. Signed-off-by: Marton Balint --- libavformat/http.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/http.c b/libavformat/http.c index 142511d091..5411aa0f29 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -190,6 +190,7 @@ void ff_http_init_auth_state(URLContext *dest, const URLContext *src) static int http_open_cnx_internal(URLContext *h, AVDictionary **options) { const char *path, *proxy_path, *lower_proto = "tcp", *local_path; + char *hashmark; char hostname[1024], hoststr[1024], proto[10]; char auth[1024], proxyauth[1024] = ""; char path1[MAX_URL_SIZE]; @@ -215,6 +216,10 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options) if (port < 0) port = 80; + hashmark = strchr(path1, '#'); + if (hashmark) + *hashmark = '\0'; + if (path1[0] == '\0') path = "/"; else