From 6848201f704b5e8e1ebdc911dba94ebc1e52c6b0 Mon Sep 17 00:00:00 2001
From: Karthick Jeyapal <kjeyapal@akamai.com>
Date: Mon, 25 Dec 2017 12:07:43 +0800
Subject: [PATCH] avformat/http: Avoid calling http_shutdown() if end of chunk
 is signalled already

---
 libavformat/http.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 7a68378acb2..c15ca522c40 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -323,9 +323,11 @@ int ff_http_do_new_request(URLContext *h, const char *uri)
         return AVERROR(EINVAL);
     }
 
-    ret = http_shutdown(h, h->flags);
-    if (ret < 0)
-        return ret;
+    if (!s->end_chunked_post) {
+        ret = http_shutdown(h, h->flags);
+        if (ret < 0)
+            return ret;
+    }
 
     if (s->willclose)
         return AVERROR_EOF;
-- 
GitLab