input_curl: don't fail when seek to EOF is requested
HTTP servers respond with "416 Requested Range Not Satisfiable" when a client attempts to seek to the end of the file. Catch this special case in input_curl_seek(). This fixes a glitch in the ogg vorbis decoder plugin.
This commit is contained in:
parent
a0dd5b7f2f
commit
a8f69429b0
@ -595,6 +595,14 @@ input_curl_seek(struct input_stream *is, off_t offset, int whence)
|
|||||||
|
|
||||||
input_curl_easy_free(c);
|
input_curl_easy_free(c);
|
||||||
|
|
||||||
|
if (is->offset == is->size) {
|
||||||
|
/* seek to EOF: simulate empty result; avoid
|
||||||
|
triggering a "416 Requested Range Not Satisfiable"
|
||||||
|
response */
|
||||||
|
c->eof = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
ret = input_curl_easy_init(is);
|
ret = input_curl_easy_init(is);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user