From patchwork Tue Dec 26 05:22:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 6971 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp6450962jad; Mon, 25 Dec 2017 21:23:22 -0800 (PST) X-Google-Smtp-Source: ACJfBovlEkCUJqbvEzMmR4GvjDpXnCKbyyyYO/Nd0K09YIAm/2tnaX/b/FDhQzdJ6FzG7EPgK5Ab X-Received: by 10.223.142.176 with SMTP id q45mr26484420wrb.6.1514265802012; Mon, 25 Dec 2017 21:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514265801; cv=none; d=google.com; s=arc-20160816; b=WZ+y1EKEl+lkWRsNmDHS6ETYY/NUDXijXd3YAZVQW1EsXW2yXhZ0Ym8mKBMTxsob8v 2RkWJTi7KeW9CYKXhyhyoD3txmtaBe42wKMM5w8z4jAnNPo+Q3C3S0sL9jM4H3JroD+O D2ZAM2sQIj+516YR2wkPUg6rkEtdC/daMP/y4fbCrNIp59bmrFZxU+OztvjYwaXthwkh ckCG6HZ4ne1Uha9gUTkddjZOhYi2fXfmOQIEI28lT8hU/mGQTC2+bgWWRfPbRa4m/Bkd BfKpz4LOoTUCkzNe1DiD5noNAhpKM9VCygqjWQtoYAFVTwaQJhlcyWKRUBsf7O6eJRwx QEjA== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=sNeUDtoO1i7T+bYVZbDGxs1AcZfmkJ1TeqdjjetorO8=; b=qgBfDNradogzlPJbXs/RI6/6INJCQAXsctzlqmUebyR915nJPFYXzn4NLhKW6Mn9bT gmCYLd+5LpkuYOtSDg03hexDg8YCeZhek9+r4WoPZwK7w4bILW/kAKxz9JoMMj4beA8S NLIb+vNRNSFlJTPcyJdu1glyD61RxtpmDgP2aD9S1s342VxDXr+XjdqOEc4CGAVhyK4W o361eEOGjS6hWLftDHkh/WTKL2DWmOutBMHjSGL8V4Bj/VKkWDxJcI/j5ay2gO3SjzVe Xqhw5DnoSm3uFaWSSWazCkn4uEhPmLOR7uvo9gLD6iNlMfTBK7MAZhuQrQEEMRVzNlZb lFqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@tmm1-net.20150623.gappssmtp.com header.s=20150623 header.b=1nUd69n8; 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 2si18366184wrj.383.2017.12.25.21.23.19; Mon, 25 Dec 2017 21:23:21 -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; dkim=neutral (body hash did not verify) header.i=@tmm1-net.20150623.gappssmtp.com header.s=20150623 header.b=1nUd69n8; 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 D723A68828E; Tue, 26 Dec 2017 07:23:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5D87680C29 for ; Tue, 26 Dec 2017 07:22:58 +0200 (EET) Received: by mail-pf0-f193.google.com with SMTP id j124so18402437pfc.2 for ; Mon, 25 Dec 2017 21:23:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tmm1-net.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=jpBeHsmrae6K0s3JSywhc5c/hYFhU5CevbKnrXc1q/U=; b=1nUd69n8WKoG5GG78hv0HUJgDwu8TPWeNN4W9DUZ+qscL7F7r8mMgIanNyxy4AGste jpsf9LW20Syp/LXBZWeJ4qgr+vWduyOJhVkFrMN7A9a02Lq5IF9Bk6yyNo3eyOk0q+WI 8+sNSfG22iak54pSmZ8IHYYTQJzdgaPhY340CWGKNrNY5oKyU3MtHqXpSslbyGr+A5G3 cPI04kCTjRXnM1i/m6n39E4RCvZyid25erU653U+Z9tLeKw07otMTQRRGtxjznd47bF1 Sb+ymv+IaWpiyQGTbH6QU1WNvJR/QiDYo50NyicNa+yPGzY0zawFlzE5jFN0vXk86g22 qzCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=jpBeHsmrae6K0s3JSywhc5c/hYFhU5CevbKnrXc1q/U=; b=IazyXbcUev1pRAWboSwmEHgaREybpy1wf5SbzFChewx9VsZObL0MW2H7gEYIh3QYG7 ADLrxMDod8pPF+aZffd3fniO7Q9IebGfj30s1fj04LdqhXuJy1bUEstOR6rISSElnF8s 6pRct41rnThbZdsDK8yxRiub9UIXSsNHlNK2p7EgQD+yLfGezbvnJu1SetfJISO/eLNS /9sPNFx3KKQVwt7Mn98rxHVTW/MwZ7mxfhrwB8+hJ8ges9agTbmXV0YJZL/IZv5Kq0eg DHDAb/H/m4hHUBfvHDDeSI/rjl8dUDck04xC6veQBHO5Q3BuHEJvTNPSAYUn+fAJePJQ bBjA== X-Gm-Message-State: AKGB3mKupJvK6yrHxA+EBUpTT/UFxl9VodRJnGJNybBrlng5m5d+eno9 9goeHVN5AtsHrVeUx7HaLy7WIlcM X-Received: by 10.99.190.10 with SMTP id l10mr13399403pgf.48.1514265789857; Mon, 25 Dec 2017 21:23:09 -0800 (PST) Received: from localhost.localdomain (c-69-181-54-242.hsd1.ca.comcast.net. [69.181.54.242]) by smtp.gmail.com with ESMTPSA id s5sm15540784pgp.91.2017.12.25.21.23.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Dec 2017 21:23:09 -0800 (PST) From: Aman Gupta To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 Dec 2017 21:22:58 -0800 Message-Id: <20171226052301.17509-1-ffmpeg@tmm1.net> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH v2 1/4] avformat/http: avoid ff_http_do_new_request after http/1.0 response 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: Aman Gupta MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Aman Gupta This makes do_new_request fail early when dealing with a http/1.0 server, avoiding unnecessary warnings shown to the user. Signed-off-by: Aman Gupta --- libavformat/http.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/http.c b/libavformat/http.c index c15ca522c4..213b6bb245 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -917,6 +917,8 @@ static int process_line(URLContext *h, char *line, int line_count, } av_log(h, AV_LOG_TRACE, "HTTP version string: %s\n", version); } else { + if (av_strncasecmp(p, "HTTP/1.0", 8) == 0) + s->willclose = 1; while (!av_isspace(*p) && *p != '\0') p++; while (av_isspace(*p))