From patchwork Thu Aug 11 09:29:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Barsnick X-Patchwork-Id: 147 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.67 with SMTP id o64csp779926vsd; Thu, 11 Aug 2016 02:30:27 -0700 (PDT) X-Received: by 10.28.166.1 with SMTP id p1mr7504911wme.85.1470907827785; Thu, 11 Aug 2016 02:30:27 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id bf8si1596652wjb.121.2016.08.11.02.30.26; Thu, 11 Aug 2016 02:30:27 -0700 (PDT) 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 6411D68A5C0; Thu, 11 Aug 2016 12:30:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 318E768A5AB for ; Thu, 11 Aug 2016 12:29:49 +0300 (EEST) Received: from paradise.fritz.box ([80.144.18.91]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M5tzh-1bIkOj3dM1-00xvIg; Thu, 11 Aug 2016 11:29:48 +0200 From: Moritz Barsnick To: FFmpeg development discussions and patches Date: Thu, 11 Aug 2016 11:29:07 +0200 Message-Id: <1470907747-5945-2-git-send-email-barsnick@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470907747-5945-1-git-send-email-barsnick@gmx.net> References: <20160810224507.GE5460@nb4> <1470907747-5945-1-git-send-email-barsnick@gmx.net> X-Provags-ID: V03:K0:dTC9pBNmW6g7f0D3yuV/xTP+YaKZzQHON38bmxLvc/Gkvp5j98C A2sIn+OYDpGXAALiHzm3Tp+iyrxVfE8DgnQUbOK40i5LQqz/F3PPuU5JCxUSMYBTGuDk2Tp yb1Tn3/t6QYfAUZZNKKKTRaTqDwOhRNjUanssEbq0yAmuPlHdCSgsvC4awlfSUcrkLt3qTL IE4L6bo+6i9eVqsPBYENw== X-UI-Out-Filterresults: notjunk:1; V01:K0:mxnUqglxcvQ=:mOJBWpdUBvSbI8ywpSwg5d bn0+JY91QCE3xqE3+rkVoCno7Hcv1UsYU40a3VhXAZVfaIlOv7/+T1l+iPbeEo7hQHd2d0tw1 3Jza01ClQJGFd5BoEa/WN950ewyVkFV10LmQu+1s32p9hidtfTp2dkfEjH0MNcUC4znuAaZE/ Cc0+E/CJCy6MnsGGXSvEawpm4nwDtcBFV7WMqF0wfl6zA2vRQOwaq+nZgZeaEbzxOSIXy319w LctLoOoMU3VAtEhucbUIE6PwSFoFpwTShLUs6+Kf9w01wG10+wc3RHG69sKGtrAtzcQGSXCpL VHuTw5cPcptgO355ZJMKh+zOPZ5S42UL2N0d6/qm90AnFekSxmgeHyCALtAIzspQSLNbluzLh JoYii6rWWkz+6Zi5Vy7zTZpYxLC219A4+JYqqAZ907h1RDJvJGaZ6wLZVjktbXCtxTSiPUSdZ NmD9kTxQOI2AcXRKQN7XSovPmvJAZhYJIG35NeIti25Wkm8lya9PbJaDsnvMC4uPJny5t/REb Z6NRWpEGowYlQkVCouOhpDhQYhfHt5xUrYqxQoswYgGpXsVaIBcOSfqsmHhv2ecickLyZMwb6 kT/3ahQ64iUrpDfpobNIHrInjjBYb8OMUDxK6O5stGhCCuWNNZlOkkBIpqOmo3XSw2QqEi+23 vDBeI3ZlUQVAzpXxPRoBkjPbbVliA8EzaX9nE8xSqHB1yA+R5FOgz5tqiuRgsp7qfg/U0A95g Oh/DZAP7Kw3KmJ7po2/pq0ShZtgSV/pntCCGe6xfOaWNCoSHIkbpKCsp73w= Subject: [FFmpeg-devel] [PATCH] libavformat/http: add support for headers option in listen mode 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: Moritz Barsnick MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Instead of silently ignoring the headers option in listen mode, use the provided headers. Signed-off-by: Moritz Barsnick --- libavformat/http.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/http.c b/libavformat/http.c index cbeaebf..adb3d92 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -371,12 +371,14 @@ static int http_write_reply(URLContext* h, int status_code) "HTTP/1.1 %03d %s\r\n" "Content-Type: %s\r\n" "Content-Length: %"SIZE_SPECIFIER"\r\n" + "%s" "\r\n" "%03d %s\r\n", reply_code, reply_text, content_type, strlen(reply_text) + 6, // 3 digit status code + space + \r\n + s->headers ? s->headers : "", reply_code, reply_text); } else { @@ -385,10 +387,12 @@ static int http_write_reply(URLContext* h, int status_code) "HTTP/1.1 %03d %s\r\n" "Content-Type: %s\r\n" "Transfer-Encoding: chunked\r\n" + "%s" "\r\n", reply_code, reply_text, - content_type); + content_type, + s->headers ? s->headers : ""); } av_log(h, AV_LOG_TRACE, "HTTP reply header: \n%s----\n", message); if ((ret = ffurl_write(s->hd, message, message_len)) < 0)