[FFmpeg-devel] [PATCH] avformat/http: clarify that ffmpeg will attempt to add missing CRLF

Gyan ffmpeg at gyani.pro
Mon Jan 28 08:59:16 EET 2019


-------------- next part --------------
From bc08c60761df77b37c83a4c285f3ca45e5045979 Mon Sep 17 00:00:00 2001
From: Gyan Doshi <ffmpeg at gyani.pro>
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';
-- 
2.19.2


More information about the ffmpeg-devel mailing list