From patchwork Mon Jan 28 06:59:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 11899 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 3095D44DEEF for ; Mon, 28 Jan 2019 08:59:20 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4F6E868B033; Mon, 28 Jan 2019 08:59:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7B21668B030 for ; Mon, 28 Jan 2019 08:59:02 +0200 (EET) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 882FDA161C for ; Mon, 28 Jan 2019 07:59:21 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id EeBJdl74L3oj for ; Mon, 28 Jan 2019 07:59:20 +0100 (CET) To: FFmpeg development discussions and patches From: Gyan Message-ID: Date: Mon, 28 Jan 2019 12:29:16 +0530 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH] avformat/http: clarify that ffmpeg will attempt to add missing CRLF 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From bc08c60761df77b37c83a4c285f3ca45e5045979 Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Mon, 28 Jan 2019 12:20:02 +0530 Subject: [PATCH] avformat/http: clarify that ffmpeg will attempt to add missing CRLF --- libavformat/http.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/http.c b/libavformat/http.c index 240304f6e6..2f2ce856bc 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -541,10 +541,13 @@ static int http_open(URLContext *h, const char *uri, int flags, int len = strlen(s->headers); if (len < 2 || strcmp("\r\n", s->headers + len - 2)) { av_log(h, AV_LOG_WARNING, - "No trailing CRLF found in HTTP header.\n"); + "No trailing CRLF found in HTTP header. Adding it.\n"); ret = av_reallocp(&s->headers, len + 3); - if (ret < 0) + if (ret < 0) { + av_log(h, AV_LOG_ERROR, + "Failed to add trailing CRLF.\n"); return ret; + } s->headers[len] = '\r'; s->headers[len + 1] = '\n'; s->headers[len + 2] = '\0';