[FFmpeg-trac] #6291(undetermined:new): http filesize incorrectly set from 416 response
FFmpeg
trac at avcodec.org
Wed Apr 5 01:17:50 EEST 2017
#6291: http filesize incorrectly set from 416 response
-------------------------------------+-------------------------------------
Reporter: ronag | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Given the code in http.c
{{{
static void parse_content_range(URLContext *h, const char *p)
{
HTTPContext *s = h->priv_data;
const char *slash;
if (!strncmp(p, "bytes ", 6)) {
p += 6;
s->off = strtoull(p, NULL, 10);
if ((slash = strchr(p, '/')) && strlen(slash) > 0)
s->filesize = strtoull(slash + 1, NULL, 10);
}
if (s->seekable == -1 && (!s->is_akamai || s->filesize != 2147483647))
h->is_streamed = 0; /* we _can_ in fact seek */
}
}}}
The filesize can be set from the content-range of a 416 response. However,
this is incorrect as what is given by a 416 response is the current size
of a resource which might still be growing. The filesize should only be
parsed and set from 200 content-length or 206 content-range, NOT from 416
content-range.
See the http spec for 416, https://tools.ietf.org/html/rfc7233#section-4.4
> the sender SHOULD generate a Content-Range header field specifying the
current length of the selected representation
--
Ticket URL: <https://trac.ffmpeg.org/ticket/6291>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list