[FFmpeg-devel,v2,1/2] avformat/http: Avoid calling http_shutdown() if end of chunk is signalled already

Submitted by kjeyapal@akamai.com on Dec. 22, 2017, 8:44 a.m.

Details

Message ID 1513932273-2788-1-git-send-email-kjeyapal@akamai.com
State New
Headers show

Commit Message

kjeyapal@akamai.com Dec. 22, 2017, 8:44 a.m.
From: Karthick Jeyapal <kjeyapal@akamai.com>

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

Patch hide | download patch | download mbox

diff --git a/libavformat/http.c b/libavformat/http.c
index cf86adc..4635a9a 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -307,9 +307,11 @@  int ff_http_do_new_request(URLContext *h, const char *uri)
     AVDictionary *options = NULL;
     int ret;
 
-    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;
+    }
 
     s->end_chunked_post = 0;
     s->chunkend      = 0;