From patchwork Wed Jan 9 06:24:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 11685 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 BA1F444BE0A for ; Wed, 9 Jan 2019 08:25:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5908C688369; Wed, 9 Jan 2019 08:24:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0743688312 for ; Wed, 9 Jan 2019 08:24:50 +0200 (EET) X-QQ-mid: bizesmtp16t1547015093t0g7zgm4 Received: from localhost (unknown [111.204.87.210]) by esmtp4.qq.com (ESMTP) with id ; Wed, 09 Jan 2019 14:24:52 +0800 (CST) X-QQ-SSF: 01100000002000F0FNF0B00A0000000 X-QQ-FEAT: AoS+/v7jDMbzJtAuEcnCAIr2/KGsSMqMr25uUAvNG1eFK5X4b0DpI5HOo8Vee sXLGXIAKhnJECrVPTaUk9MsxUcdQmcE3Bb37Eol9/elqx2a5Mgla10M8WubHtuGDb4817O3 rv2FLAyrbwsn0yM+cTjyUeezTBt2MnutxoyEUaGYrfxq8YO2iTkXrTnopTduVrslzx6NNok bh1b/OpC0NzYWe+aDUcjHM7+ysFmZuJd/FOy/FmttTweTKDcxA48xikpKWsud3EwZ180GVF tu56HUv5yFkxyWHd9vjq0ib5IKExnB+FuTHg== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Wed, 9 Jan 2019 14:24:50 +0800 Message-Id: <20190109062450.37901-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.15.2 (Apple Git-101.1) X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] avformat/http: ignore the string after char '#' 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: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" fix ticket: 7660 Because the char '#' is used for webbrowser to display, it won't present in URI of http request. Signed-off-by: Steven Liu --- libavformat/utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 7afef545fe..f93837a805 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4731,6 +4731,7 @@ void av_url_split(char *proto, int proto_size, int *port_ptr, char *path, int path_size, const char *url) { const char *p, *ls, *ls2, *at, *at2, *col, *brk; + char *bp; if (port_ptr) *port_ptr = -1; @@ -4758,6 +4759,9 @@ void av_url_split(char *proto, int proto_size, } /* separate path from hostname */ + bp = strchr(p, '#'); + if (bp) + *bp = '\0'; ls = strchr(p, '/'); ls2 = strchr(p, '?'); if (!ls)