summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorDaniel Kucera <daniel.kucera@gmail.com>2017-10-17 10:29:30 +0200
committerNicolas George <george@nsup.org>2017-10-19 22:07:21 +0200
commit858db4b01fa2b55ee55056c033054ca54ac9b0fd (patch)
tree5a29252c4545b4ff80bb0beead0628812d0b73b9 /libavformat/http.c
parentf4090940bd3024e69d236257d327f11d1e496229 (diff)
libavformat: not treat 0 as EOF
transfer_func variable passed to retry_transfer_wrapper are h->prot->url_read and h->prot->url_write functions. These need to return EOF or other error properly. In case of returning >= 0, url_read/url_write is retried until error is returned. Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 668cd51986..bd9148f45d 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1296,8 +1296,11 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
"Chunked encoding data size: %"PRIu64"'\n",
s->chunksize);
- if (!s->chunksize)
+ if (!s->chunksize) {
+ av_log(h, AV_LOG_DEBUG, "Last chunk received, closing conn\n");
+ ffurl_closep(&s->hd);
return 0;
+ }
else if (s->chunksize == UINT64_MAX) {
av_log(h, AV_LOG_ERROR, "Invalid chunk size %"PRIu64"\n",
s->chunksize);