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>
This commit is contained in:
Daniel Kucera
2017-10-17 10:29:30 +02:00
committed by Nicolas George
parent f4090940bd
commit 858db4b01f
5 changed files with 27 additions and 17 deletions

View File

@@ -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);