diff options
author | Martin Storsjö <martin@martin.st> | 2014-08-11 10:18:28 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2014-08-13 14:34:25 +0300 |
commit | 8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f (patch) | |
tree | ddc9fc29a715d82a7c08ee69524a41e3a6f5a26e /compat | |
parent | da7d839a0d3ec40423a665dc85e0cfaed3f92eb8 (diff) | |
download | ffmpeg-8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f.tar.gz |
http: Stop reading after receiving the whole file for non-chunked transfers
Previously this logic was only used if the server didn't
respond with Connection: close, but use it even for that case,
if the server response is non-chunked.
Originally the http code has relied on Connection: close to close
the socket when the file/stream is received - the http protocol
code just kept reading from the socket until the socket was closed.
In f240ed18 we added a check for the file size, because some
http servers didn't respond with Connection: close (and wouldn't
close the socket) even though we requested it, which meant that the
http protocol blocked for a long time at the end of files, waiting
for a socket level timeout.
When reading over tls, trying to read at the end of the connection,
when the peer has closed the connection, can produce spurious (but
harmless) warnings. Therefore always voluntarily stop reading when
the specified file size has been received, if not using a chunked
transfer encoding. (For chunked transfers, we already return 0
as soon as we get the chunk header indicating end of stream.)
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'compat')
0 files changed, 0 insertions, 0 deletions