From 033f53fb8f4c095e8d465e90325bc4521c4ddca6 Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Sun, 23 Sep 2012 15:26:56 +0200 Subject: Document why we always send a Range HTTP header. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Reimar Döffinger --- libavformat/http.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat/http.c') diff --git a/libavformat/http.c b/libavformat/http.c index 85ed7a5c81..ede4e8b6f6 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -411,6 +411,9 @@ static int http_connect(URLContext *h, const char *path, const char *local_path, if (!has_header(s->headers, "\r\nAccept: ")) len += av_strlcpy(headers + len, "Accept: */*\r\n", sizeof(headers) - len); + // Note: we send this on purpose even when s->off is 0, + // since it allows us to detect more reliably if a (non-conforming) + // server supports seeking by analysing the reply headers. if (!has_header(s->headers, "\r\nRange: ") && !post) len += av_strlcatf(headers + len, sizeof(headers) - len, "Range: bytes=%"PRId64"-\r\n", s->off); -- cgit v1.2.3