[FFmpeg-devel] [PATCH] http: Manually return EOF at the end of the content if the server doesn't handle Connnection: close properly
Martin Storsjö
martin
Sun Aug 8 12:55:20 CEST 2010
Hi,
When doing http requests, we set Connection: close as one of the
request headers, to tell the server that it should close the connection
after serving us the file we requested. If the server doesn't handle this
request properly, the connection will remain open after the file has been
served, and we block for a long while trying to read more data (when all
data accounted for in Content-Length has been served).
The attached patch checks if the server replies with a Connection: close
header in the response header - if not, and if Content-Length was
provided, we manually return AVERROR_EOF when we've got enough data.
In principle, we could always do this as long as a content length was
provided, but this only does it for the case where the server doesn't
handle Connection: close.
I noticed this when testing the Apple HTTP Live Streaming protocol against
a Wowza server, that simply keeps the connection open after serving the
file content, leading to huge delays until getting EOF for the files (when
the server chose to time out the HTTP connection).
// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-http-Manually-return-EOF-at-the-end-of-the-content-i.patch
Type: text/x-diff
Size: 1899 bytes
Desc:
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100808/573f2997/attachment.patch>
More information about the ffmpeg-devel
mailing list